Skip to content

Commit

Permalink
Add support for multiple guards
Browse files Browse the repository at this point in the history
  • Loading branch information
iman-ragab authored and edgrosvenor committed Feb 11, 2021
1 parent 3e11303 commit 9629b0c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/LaravelPasswordlessLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ public function login(Request $request)

$redirectUrl = $user->redirect_url ?? ($request->redirect_to ?: config('laravel-passwordless-login.redirect_on_success'));

Auth::guard($guard)->login($user, $rememberLogin);

abort_unless($user == Auth::guard($guard)->user(), 401);
if (method_exists(Auth::guard($guard), 'login')) {
Auth::guard($guard)->login($user, $rememberLogin);

abort_unless($user == Auth::guard($guard)->user(), 401);
}

return $user->guard_name ? $user->onPasswordlessLoginSuccess($request) : redirect($redirectUrl);
}
Expand Down

0 comments on commit 9629b0c

Please sign in to comment.