diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index baf9331..26c45ce 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -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");