public function postTwoFactorAuthentication(Request $request) { $user_id = Session::pull('2fa_user_id'); $remember = Session::pull('2fa_login_remember'); if ($user_id) { $auth = Auth::guard($this->getGuard()); $auth->loginUsingId($user_id, $remember); if ($this->google2fa->verifyKey($auth->user()->google2fa_secret, $request->get('2fa_code'))) { return $this->handleUserWasAuthenticated($request, true); } $auth->logout(); return redirect()->route('auth.login')->withError(Lang::get('auth.invalid_code')); } return redirect()->route('auth.login')->withError(Lang::get('auth.invalid_code')); }