כיצד ניתן להשבית 2FA עבור משתמש בזמן שאנו משתמשים בכניסה באמצעות Google auth2 ב-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

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