go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.19k stars 5.42k forks source link

2FA not working #32091

Closed rubenelshof closed 2 hours ago

rubenelshof commented 3 hours ago

Description

Upon opening Gitea I had to relogin. After giving the username and password I had to enter the 2FA code but was rejected multiple times. I than had to use the 2FA recovery key to login.

I have tried to re-enroll my phone but after scanning the QR code and typing in the resulting 2FA code I get the message 'The passcode is incorrect. Try again.'

I am able to enroll my phone on the demo site.

Gitea Version

1.23.0+dev-496-g1fede04b83

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker

Database

PostgreSQL

wxiaoguang commented 3 hours ago

For > 99% cases: your server/mobile/pc time is out of sync, please make sure all your devices have accurate time.

rubenelshof commented 3 hours ago

I am almost 100% certain that the time's are all in sync. Additionally I have also tried to enroll the phone via my laptop aswell as use a different authenticator app. Same issue.

wxiaoguang commented 2 hours ago

What you see might not be what it is, especially when there is "timezone"

rubenelshof commented 2 hours ago

I hadn't thought about the server time. It was indeed out of sync. I have 2FA working again. Thank you for helping out.