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

502
April 12, 2018, at 4:14 PM

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

Answer 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.

Thanks for suggestions.

Rent Charter Buses Company
READ ALSO
Easy way to generate report from 8 different parameters in php mysql [on hold]

Easy way to generate report from 8 different parameters in php mysql [on hold]

I want to run report from 8 different combinationEach input can be empty or can be filled with data

161
“Class App\Repositories\TodoInterface does not exist” Laravel 5.5

“Class App\Repositories\TodoInterface does not exist” Laravel 5.5

I'm trying to implement repositories in my application structure

245
Upload progress bar using session.upload_progress

Upload progress bar using session.upload_progress

Implemented progress bar using sessionupload_progress, Worked fine for some days

197
How can I post a form via PHP Curl and By Pass Google Recaptcha [on hold]

How can I post a form via PHP Curl and By Pass Google Recaptcha [on hold]

How can I post a form via PHP Curl and By Pass Google Recaptcha

152