I have a API in lumen framework and I'm using passport to authenticate the routes but I need that some routes use basic auth (with users table data and pront to enter user/pass) instead passport.
bootstrap/app.php
$app->routeMiddleware([
'auth' => Froakie\Http\Middleware\Authenticate::class,
'auth.basic' => Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'validateJson' => Froakie\Http\Middleware\ValidateJsonMiddleware::class,
]);
routes.php
$router->get('/test', ['middleware' => ['auth.basic'], function () {
return view('welcome');
}]);
I try that but returns a error.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire