My old phone has a broken screen, and it was the device I used for two-factor authentication on my GitHub account. I no longer have the authenticator access or recovery codes, so I can't complete the login process on my new phone. Is there a way to reset two-factor authentication or recover the account and enroll a new device?
2 Answers
First, check whether you’re still signed in on another browser, computer, or the mobile app. If you find an active session, go to your account security settings and generate new recovery codes or register your new phone before that session expires. If you’re not signed in anywhere, try the official account recovery process. It may also recognize an SSH key that was previously added to the account, so try that before contacting support.
Without the old authenticator and recovery codes, account recovery is the main option. There usually isn’t a simple way to bypass two-factor authentication, so follow the provider’s recovery steps and provide any requested verification details.

Unfortunately, I’m not signed in anywhere anymore. I was logged in previously, but the session ended unexpectedly, so I’ll try the recovery process and check whether an old SSH key can help.