forked from mirror/pixelfed
Update AccountController
This commit is contained in:
parent
fe7d58af85
commit
6074c56838
1 changed files with 8 additions and 4 deletions
|
@ -446,12 +446,16 @@ class AccountController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
if($request->session()->has('2fa.attempts')) {
|
if($request->session()->has('2fa.attempts')) {
|
||||||
$count = (int) $request->session()->has('2fa.attempts');
|
$count = (int) $request->session()->get('2fa.attempts');
|
||||||
$request->session()->push('2fa.attempts', $count + 1);
|
if($count == 3) {
|
||||||
} else {
|
Auth::logout();
|
||||||
$request->session()->push('2fa.attempts', 1);
|
return redirect('/');
|
||||||
}
|
}
|
||||||
return redirect()->back()->withErrors([
|
$request->session()->put('2fa.attempts', $count + 1);
|
||||||
|
} else {
|
||||||
|
$request->session()->put('2fa.attempts', 1);
|
||||||
|
}
|
||||||
|
return redirect('/i/auth/checkpoint')->withErrors([
|
||||||
'code' => 'Invalid code'
|
'code' => 'Invalid code'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue