Answer the question
In order to leave comments, you need to log in
How to make both web and api authentication in Laravel?
There is a control panel written in Laravel c Blade.
It is necessary that a separate crm is connected to it, it will be either on a separate domain or subdomain, it works on NUXT I use jwt-auth.
Now the entrance to the panel is through the usual web login form.
In auth.php is
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
'defaults' => [
'guard' => 'api',
'passwords' => 'users',
],
Answer the question
In order to leave comments, you need to log in
jwt-auth has nothing to do with this. You leave "web" by default, and use an explicit guard call in all api methods, for example: auth()->guard('api'), the JWTAuth facade also helps out, it automatically switches the context of Auth::user().
https://github.com/tymondesigns/jwt-auth/issues/1746
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question