I had an issue where my ssl cert expired and the HA login screen was still loading and accepting a password. Every time I would submit the password I got the API unexpected error. The page would still load even if I turned off my HA instance. The problem was solved by renewing my ssl cert through letsencrypt. It was a difficult problem to diagnose because there weren’t any logs on my system and the login page error is so cryptic. I’m guessing the app is caching something that my browser retains despite not being able to connect.
Feature Request: Better erroring when something goes wrong when logging in or a better message from the login screen saying it can’t connect to the HA instance.
I’m happy to answer any questions or offer more clarification on the problem I was having.