A recovery code can only be used to log in once. When a user logs in with a recovery code, we delete their old recovery code and automatically generate a new one, but we don't currently show it to the user.
Instead, we should aggressively show the user their new recovery code, and maybe also encourage them to set up a new 2FA method.
@AAlhazwani-WMF has given us the design above, but I propose doing this slightly differently. When a user logs in with a recovery code, I propose we:
- Redirect them to Special:AccountSecurity/recoverylogin , instead of where they would otherwise have gone
- If the user has JavaScript enabled:
- Display the page as usual, but show the modal dialog on top of it with the new recovery code as in Amin's design
- In this dialog, add a message encouraging the user to set up a new 2FA method
- When they close the dialog, they are on the main Special:AccountSecurity page and the buttons to add a new method are right there
- If the user does not have JS:
- Hide the normal page content using CSS, and instead display the new recovery code and the encouragement to set up a new 2FA method
- Make the "Done" button reload Special:AccountSecurity but in "normal" mode







