Reputation: 394
I have a Laravel 5.5 application I am able to login with API but unable to access routes with "auth:api" middleware.
Sending headers like
1 . Accept = application/json
2 . Authorization = Bearer eyJ0eXAi.....xxxxxxxx
In api.php
Route::middleware('auth:api')->group(function(){
Route::post('user', 'Api\Auth\PassportController@getDetails');
}
This working on local but not on server.
Checked error_log file and laravel.log file. But no luck.
Don't know whats wrong. Please help me to solve this issue.
Upvotes: 1
Views: 2755
Reputation: 935
After hours of searching and moving many lines of code:
php artisan config:clear
Works for me!
Idea from: https://github.com/laravel/passport/issues/452
Upvotes: 1