diff --git a/config/passport.php b/config/passport.php index 79c59acb1..06053cd12 100644 --- a/config/passport.php +++ b/config/passport.php @@ -2,6 +2,19 @@ return [ + /* + |-------------------------------------------------------------------------- + | Passport Guard + |-------------------------------------------------------------------------- + | + | Here you may specify which authentication guard Passport will use when + | authenticating users. This value should correspond with one of your + | guards that is already present in your "auth" configuration file. + | + */ + + 'guard' => 'web', + /* |-------------------------------------------------------------------------- | Encryption Keys diff --git a/routes/web.php b/routes/web.php index c9d78fb1e..fa2ecf3fe 100644 --- a/routes/web.php +++ b/routes/web.php @@ -14,7 +14,9 @@ 'middleware' => 'web', ]); -Route::middleware(['web', 'auth'])->group(function () { +$guard = config('passport.guard', null); + +Route::middleware(['web', $guard ? 'auth:'.$guard : 'auth'])->group(function () { Route::post('/token/refresh', [ 'uses' => 'TransientTokenController@refresh', 'as' => 'token.refresh',