In your routes/api.php, you should change Route::middleware('auth:api') to Route::middleware('auth'), so it will use default (probably 'web') guard for authentication instead of 'api' guard
Jun 12, 2018
2
Level 3
Use the authenticated user of the session in laravel API
I have a session login system for a few guards. I'm using Vue a lot and I came to the point where I need authentication in Vue in order to fetch and post data properly. The question is how could I get the authenticated session user to work with API. So in api.php I want to use a controller whose Middleware the authenticated user. I don't want to use Passport because I only have logins over the webpage and not API.
Please or to participate in this conversation.