Disable 2FA from commandline

Hi,

I lost the device I used for 2FA and my scratch codes with it.
Is it possible to disable 2FA for my user from the commandline (like ./gitea admin ) or by setting a config option or changing a database field?

I have full access to the server and database, just not getting into gitea.

thanks in advance,
Tist

Delete the record on table two_factor via uid is your id on table user which will help you login with your password.

1 Like

Thanks, Iḿ back in my gitea instance!

Hate to necro but since this is one of the only articles discussing the topic, if you use a webauthn security key, you’ll need to inspect the webauthn_credential table instead of two_factor!