Users reported an issue where the Two-Factor Backup Codes section does not display the “Add backup codes” button immediately after adding a 2FA authenticator. The workaround was to refresh the page. sebix1 initially reported the bug, and pmusaraj confirmed it. stromfeldt mentioned the issue persisted over a year. keegan later pushed a fix, resolving the problem. sebix1 expressed gratitude for the resolution.
After adding a 2FA authenticator, the second-factor page shows correctly the added authenticator.
The Two-Factor Backup Codes sections only says:
You must enable a primary two-factor method before generating backup codes.
It’s necessary to leave the profile page and enter it again (or reload the page) to see the “Add backup codes” button.
Unfortunately, I can’t upload a screenshot here as the software always says “Sorry, but your upload failed. Please try again.” (the POST request to https://meta.discourse.org/uploads/complete-multipart.json returns a 422 with also just this text as JSON’ed body). But the content of the screenshot isn’t very enlightening anyway.
Yes, I can confirm that I have seen this as well, we should refresh the view after adding the 2FA authenticator so that backup codes can be created right away.
I was about to file a bug report as I just went through three attempts (of enabling and disabling 2FA) on two different browsers trying to generate backup codes, but fortunately did a search first. Anyway, as it’s been more than a year and this hasn’t been addressed, and supposing it may have fallen through the cracks, I figured I’d mention that this issue still exists.