Skip to content

Commit

Permalink
fix totp error
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiritin committed Jan 22, 2024
1 parent 6ca4402 commit 47b5abe
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ public function submit(LoginRequest $request)
return Redirect::route('verification.notice');
}

return Redirect::signedRoute('auth.two-factor', [
'login_challenge' => $request->get('login_challenge'),
'user' => $user->hashid,
'remember' => $request->get('remember') ?? false,
], now()->addMinutes(30));
if ($user->twoFactors()->exists()) {
return Redirect::signedRoute('auth.two-factor', [
'login_challenge' => $request->get('login_challenge'),
'user' => $user->hashid,
'remember' => $request->get('remember') ?? false,
], now()->addMinutes(30));
}

$url = (new Client())->acceptLogin($user->hashId(), $request->get('login_challenge'),
$request->get('remember') ? "2592000" : "3600");
Expand Down

0 comments on commit 47b5abe

Please sign in to comment.