Lost APP_KEY
garfieldairlines opened this issue · comments
Hello,
I migrated the docker container and to be honest I forgot that the APPP_KEY setting was a thing. So I can't connect to Monica.
Is there a way to hard reset the user password ? I am the admin of MariaDB after all…
Hawoof @garfieldairlines,
In Theorie yes
in my case i would firstly setup a new Monica with the new Secret
After that i would create a new user, go to the Database->Table:users and then copy the password
Then i would start the Old Monica with the new Secret and go again to Database->Table:users and then replace the old password string with the new Password String ^^
And then in theory it should work
i'm right @djaiss ?
Nope, getting "The MAC is invalid."
So in theory, this is how you should do:
- generate a new APP_KEY in your project with
php artisan key:generate
in the console - get the encrypted password by invoking Tinker (
php artisan tinker
) and typingHash::make('YOUR_NEW_PASSWORD')
as shown below - update the password of your user in the database manually.
This will update the system with the new password.
In that time I went the "long" route and made dumps after dumps of each relevant table, changed Monica to use the second table and it works (except for WebAuthn).
Wasn't easy but for the future I'm documenting it (…and keeping the APP_key, totally forgot that one when migrating docker)
You can reset the password with the reset password form.