You can use Auth::check on the API side as well.
Jun 23, 2018
3
Level 1
User session in API response
Hello,
I have a request where I need to refactor existing laravel app, to use ajax/api instead of classic web-routes. API is implemented with JWT token auth. The problem is that frontend is done with blade templates that relies a lot on (Auth::check()) function. And in login with API laravel_session cookie with auth user is not set and the view is not responding properly. Is it possible to return session for the user in API and store it manually in a cookie? Or there is a better approach to solve this?
Thanks,
Please or to participate in this conversation.