gitea: After login providing two-factor auth 5XX errors. Can't login.

Description

When logging in, and after proving a correct two-factor auth token, I am shown a 5XX error. The logs don’t provide a stack trace so can’t see where in the code it’s breaking.

[Macaron] 2020-08-01 23:10:07: Started POST /user/two_factor for 10.244.1.1
[Macaron] 2020-08-01 23:10:07: Completed POST /user/two_factor 500 Internal Server Error in 19.568867ms

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

I was able to work around this by getting a shell into PostgreSQL and running:

update two_factor set uid = 111 where id = 1;

Note that uuid = 111 does not exist, but this prevented the two-factor auth screen from showing when logging in. Not sure what happened. An interesting note, is I did go enable two-factor auth again for my same user, logout, then log back in and it worked using two-factor without a 5XX error.

After that I went and deleted the old (broken) two-factor entry in PostgreSQL manually:

delete from two_factor where id = 1;