I got involved into a new laravel project and tryed running the unit tests (that pass on my friend's project), and I got some fails. I looked into the laravel.log and saw multiple times this one:
testing.ERROR: Illuminate\Contracts\Encryption\DecryptException: The MAC is invalid. in /mnt/c/xampp/htdocs/erx/vendor/laravel/framework/src/Illuminate/Encryption/BaseEncrypter.php:48
I tryed clearning the cache, and also running:
php artisan key:generate
but that didn't remove the problem. Is there anything else that I should try?
Your APP_KEY is probably not the same as local/remote. Crypt::decryptString
then throws MAC is invalid
error.
You should be able to get rid of this when you clean cache and cookies in the browser.
Also make sure keys are same.
I may happen when you setup on dev machine new instance and open a browser with one APP_KEY and then regenerated it and trying to refresh page.
If it's the case: try to clear cookies in the browser. It will wipe session and new one will be created automatically using newly created key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With