Update AccountController

This commit is contained in:
Daniel Supernault 2020-05-24 02:04:53 -06:00
parent fe7d58af85
commit 6074c56838
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 8 additions and 4 deletions

View File

@ -446,12 +446,16 @@ class AccountController extends Controller
}
if($request->session()->has('2fa.attempts')) {
$count = (int) $request->session()->has('2fa.attempts');
$request->session()->push('2fa.attempts', $count + 1);
$count = (int) $request->session()->get('2fa.attempts');
if($count == 3) {
Auth::logout();
return redirect('/');
}
$request->session()->put('2fa.attempts', $count + 1);
} else {
$request->session()->push('2fa.attempts', 1);
$request->session()->put('2fa.attempts', 1);
}
return redirect()->back()->withErrors([
return redirect('/i/auth/checkpoint')->withErrors([
'code' => 'Invalid code'
]);
}