@mark_kcc Just to be sure, but your API routes are inside api.php and your web routes inside web.php?
Laravel 8 JWT API and normal login
HI I have an app that has a login page and end points for API. I am using tymon/jwt-auth for the API auth but cannot get both the login page to and API at the same time. In the config/auth.php settings the defaults/guard to web and allows me to login to the site but kills the API requests and setting it to api allows the api but not the login. I'm sure it's a routing issue but cannot figure it out.
I have a http/controllers/API/contollers AuthController and http/controllers/HomeController.
The API route:
Route::get('/auth', [AuthController::class, 'auth']);
Route::middleware('auth:api')->group(function () { Route::resource('buildings', BuildingController::class); });
The WEB route:
Route::get('/', function () { return view('auth.login'); });
Auth::routes([ 'register' => false, 'reset' => false, 'verify' => false, ]);
Route::get('/buildings-index', [HomeController::class, 'buildings'])->name('buildings-index');
Cheers
Please or to participate in this conversation.