How to fix laravel passport 401 error

How to fix laravel passport 401 error

Sometimes you may face registration/login issue with laravel passport and getting error 401, this error causes:

It will not login the user

It will not redirect user

and return such error in network:

status = 500
message Trying to get property 'client' of non-object
exception   ErrorException
PHP

and in console something like:

Unhandled promise rejection Error: "Request failed with status code 500"
Bash

Solution

Apparently each time you refresh migrations you have to install new passport and generate new keys.

After refreshing migrations run command below and it should be working with no issue:

php artisan passport:install --force

- Last updated 1 year ago

Be the first to leave a comment.

You must login to leave a comment