DecryptException in BaseEncrypter.php line 48: The MAC is invalid. laravel 5.2

强颜欢笑 提交于 2019-12-12 07:01:39

问题


I know this question has already been asked. But none of them solve my issue.

I am facing the issue : DecryptException in BaseEncrypter.php line 48: The MAC is invalid.

I checked my .env file there is no space in APP_DEBUG and APP_KEY

Tried to generate new key but nothing worked out.

Laravel Framework version 5.2.45


回答1:


After surfing for around two hours , tried so many solution form different sources but none of them solved my problem.

  1. There may be reason then .env file have space in APP_DEBUG and APP_KEY key.

    By removing the space if exists can solve the problem.

  2. By clearing cache, composer dump-autoload can also be used in some cases.

  3. But in my case the issue was either

    DecryptException in BaseEncrypter.php line 48: The MAC is invalid

    or

    DecryptException in BaseEncrypter.php line 45: The payload is invalid

    The issue was because of database column issue.

    The column type was varchar and length was 256 that was creating whole issues. As field mwsAuthToken has lenght more then filed 256 and was truncating the mwsAuthToken key value.

    Thus by changing the field type to text solved my problem.



来源:https://stackoverflow.com/questions/49788839/decryptexception-in-baseencrypter-php-line-48-the-mac-is-invalid-laravel-5-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!