I am able to access routes declared in the api.php(route) with middleware 'api'. But not able to do the same with the routes that has 'auth:api'. I guess only authenticated users can access the latter route. But when i access it after logging in , it just redirects me to home. how to fix this or am i following wrong procedure ?
Route::get('/user', function () {
echo "Hello";
})->middleware('auth:api');
Route::get('/work',function(){
echo "Hello";
})->middleware('api');