Disable two factor auth with only backup codes

AI-generated summary

tajchumber lost their Google Authenticator codes after resetting their phone but retained backup codes to log in to their Discourse account. However, they were unable to disable Two-Factor Authentication (2FA) because the interface only accepted 6-digit codes, while backup codes are 16 characters long tajchumber. codinghorror initially suggested disabling 2FA via user preferences, but confirmed the issue after learning backup codes differ in length codinghorror. codinghorror proposed staff intervention as a workaround, while tajchumber humorously requested both solutions. zogstrip assigned maja to fix the issue, which was resolved via a code commit enabling backup codes to work in the 2FA disable flow. tajchumber confirmed the fix and thanked maja.

Hello everyone,

I recently had to reset my phone so I lost all my Google Authenticator codes (for Two-Factor Authentcation)

I have backup codes so I can log in to my Discourse accounts but I cannot disable/update two factor auth from my account.

Is there a way to do it that I missed?

Thanks for all the help!

If you can log in (you kept backup codes, excellent work), you can disable two factor. Just edit it in your user preferences.

I tried, it asks me an authentication code (which obviously I don’t have) and it doesn’t allow me to input one of my backup codes on the input field (It only allows 6 characters)

Our CSS there looks a little messed up cc @Johani. Worth a check.

I thought the backup codes worked the same as the app codes, is this not the case @nbianca?

@codinghorror authentication codes from apps are 6 character longs while the generated backup codes are 16

The other option is to have a staff member disable 2FA on your account, but I agree we should fix this up since you’re currently stuck.

Hope I’m not asking a lot but can we do both? I’d like to be able to access my accounts ahaha

Actually, @maja can you take a break from the Ember 3.7 upgrade and ensure we can disable 2FA using either authentication or backup codes?

This has been fixed per this commit:

https://github.com/discourse/discourse/commit/6f427589b2d79f0c66b6183762a9b122ecdadc10

Sorry for the inconvenience @tajchumber

Now it works like a charm! thanks @maja :slight_smile: