Jatin Raikwar
Jatin Raikwar

Reputation: 394

Api auth middleware is not working on serve

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

Answers (1)

Jhon Didier Sotto
Jhon Didier Sotto

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

Related Questions