Kan 2FA niet uitschakelen voor gebruiker

AI-generated summary

A user is unable to disable 2FA for a specific user via the admin interface, receiving an ‘invalid parameters’ error. The issue arises because the user has a UserSecurityKey record but no UserSecondFactor record, preventing the UI from functioning correctly. Brandon_Martus resolves the issue by removing the UserSecurityKey via the Rails console, which successfully disables 2FA. omarfilip suggests using the console, while jomaxro and Falco highlight that the site is running an outdated and unsupported version of Discourse (2.5.0.beta4), missing critical security fixes, and recommend an immediate upgrade.

We have a user with 2FA enabled, and we cannot disable it for them.

Clicking the ‘Disable’ button on their account gives us:


(You supplied invalid parameters to the request: Discourse::InvalidParameters)

There is no row in the users_second_factors table for the user_id. I’ve tried adding a dummy row, which lets me click the ‘Disable’ button without error, but just deletes my dummy row and still leaves 2FA enabled for the user.

I’ve also tried the rake users:disable_2fa[username] rake task, which says 2FA disabled for user, but still shows Two Factor Authentication: Yes on the user’s profile in admin.

Anything else I can try?

Try via the rails console:

It’d also be good to know what version of Discourse you are running. There have been fixes for the inability to disable 2FA via the UI since the first release of 2FA.

Thanks @omarfilip .. I did the UserSecondFactor delete but didn’t know about UserSecurityKey.

This user had no UserSecondFactor record, but they did have a UserSecurityKey record.

Once I removed that, their profile shows ‘Two Factor Authenciation: No’ – thanks!

@jomaxro We’re on 2.5.0.beta4 ( 8d3900c6da )

Seems like there still is an issue where I should be able to do this via the UI, but get the invalid parameters issue, possibly due to the missing UserSecondFactor record?

That version is old and unsupported, update as soon as possible.

Besides being old and unsupported, you’re also missing over a dozen security fixes, so your site is vulnerable. Please do upgrade.