I had 2FA enabled until just a moment ago. After my computer restarted abruptly (thanks Windows ), I was locked out on homeassistant.local:8123, because it wouldn’t accept my 2FA code. Thankfully, I was still logged in on nabu casa, so I was able to disable the 2FA.
Now I am unable to enable it again. When I try to set it up again, it is giving this error message: Invalid code, please try again. If you get this error consistently, please make sure the clock of your Home Assistant system is accurate.
I am on HA OS 7.5, Core 2022.3.5.
I have already tried restarting HA Host. I am not sure what else to try.
Unfortunately, I’m not sure how to fix this apart from saying check your timezone settings. I’m not sure where you’re based but if you’re in the UK the clocks went forward by 1 hour today and this might be causing the issue. I need to investigate similar things on my side too as had a node-red automation trigger an hour late which I think is also related to the clocks.
Took me a while, but I finally figured out that after my laptop rebooted (on its own), the clock on Windows was off. And none of my 2FA were working, if copied from the Bitwarden browser extension. After fixing my laptop’s clock, it started working again.
Thanks, this helped me to resolve my problem. My time on the VM was just 5 minutes behind. Installing NTP has corrected issue right after installation automatically.