How can we disable 2FA for an user while we are using google auth2 login in Discourse?

How can we disable 2FA for an user while we are using google auth2 login in Discourse?

If the user lost the phone or has no access to the old Authenticator token you can simply destroy the old token entering your Rails console and (after entering the real username instead of <USERNAME>) run

id = User.find_by_username('<USERNAME>').id
UserSecondFactor.where(user_id: id)
UserSecondFactor.where(user_id: id).each(&:destroy!)

The user will be able to request another token during the login

1 Like

@dax Will it work for my case because I am using google auth2 logins not DiscourseConnect for SSO ?