Reputation: 905
I want to remake my Laravel application, but I'm keeping the same old DB. So I don't want users passwords to become invalid.
Do I need to copy the APP_KEY from my current app into the new one?
What else would I need to do to make sure my users won't have any trouble logging into the new App using their current passwords?
Upvotes: 1
Views: 1195
Reputation: 5552
APP_KEY is used for encryption, not hashing, so your user passwords will not be affected.
What will be affected are encrypted session cookies. Changing APP_KEY will effectively cause all users to be logged out, and invalidate any existing session cookies. This is probably okay, but something worth paying attention to.
If you use encryption for any of your database data, you will also need to decrypt all of the existing data with the previous key and re-encrypt with the new key.
If you're using Laravel Passport and have long-lived access tokens, they may also become invalid and need to be re-issued.
Upvotes: 1
Reputation: 677
This is a common misconception.
Laravels passwords are hashed using Hash::make() or bcrypt(), neither of which use APP_KEY so it shouldn't affect it.
You shouldn't need to do anything, I sometimes have several test databases which I switch between, and haven't had any problems.
The APP_KEY is actually used for encrypted cookies, including Session cookies
Upvotes: 3