Update Two factor middleware to allow 3 attempts

This commit is contained in:
Daniel Supernault 2019-10-07 03:25:26 -06:00
parent 2c16db187b
commit d3eaccf706
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -24,7 +24,7 @@ class TwoFactorAuth
if($request->session()->has('2fa.session.active') !== true && !$request->is($checkpoint)) if($request->session()->has('2fa.session.active') !== true && !$request->is($checkpoint))
{ {
return redirect('/i/auth/checkpoint'); return redirect('/i/auth/checkpoint');
} elseif($request->session()->has('2fa.attempts') || (int) $request->session()->get('2fa.attempts') > 3) { } elseif($request->session()->has('2fa.attempts') && (int) $request->session()->get('2fa.attempts') > 3) {
$request->session()->pull('2fa.attempts'); $request->session()->pull('2fa.attempts');
Auth::logout(); Auth::logout();
} }