Oops...I broke my users

I deleted a database file from my HA config folder as I had moved over to MySQL, but I am guessing that HA had stored my new user credentials in there as it is now broken. I can’t log in anymore with the two users I set up (Including the admin/owner). I am still able to log in with the legacy API password that I had also enabled.

I tried to run the script that was released a few releases ago when the new user system was first previewed, but I’m running HA on Docker and I can’t work out if it’s even possible to run it under docker (the hass command doesn’t work in the docker CLI).

Anyone have any idea how I can re-create my main user and get back up and running?

Configuration>Users and add a user

Unfortunately that doesn’t work. I think (currently) only the first/master user can add new users. I just get the error “unauthorized” when I try and add.

There’s a hidden .storage folder. Delete that and it will onboard you again

As @DavidFW1960 point out, user was stored in [config_folder]/.storage/auth file, not database.

That worked, thanks! Not sure why it broke then

Same problem here. If I remove “.storage” folder, the folder and the auth file is recreated (after I login with my legacy API password again), guess it gets it from the MariaDB database?

Same problem here. I can login with Legacy API Password and I can’t create any user. When I delete the folder “storage”, it is recreated with “auth” file in it.
Any suggestion?
Thank you!

It will recreate the folder when you login.

Which version of HA are you using?

What do you have in config yaml? Do you have an auth: section? hat is in the http: section?

I managed to do it when I cleared the cache of my browser! Thank you!