Disable 2FA from commandline



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,


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


Thanks, Iḿ back in my gitea instance!