mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Some scrutiniser related code cleanup.
This commit is contained in:
@@ -52,10 +52,10 @@ class AuthenticateTwoFactor
|
||||
return redirect()->guest('login');
|
||||
}
|
||||
}
|
||||
$twoFactorAuthEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
||||
$hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
|
||||
$isTwoFactorAuthenticated = Session::get('twofactor-authenticated');
|
||||
if ($twoFactorAuthEnabled && $hasTwoFactorAuthSecret && !$isTwoFactorAuthenticated) {
|
||||
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
||||
$has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
|
||||
$is2faAuthed = Session::get('twofactor-authenticated');
|
||||
if ($is2faEnabled && $has2faSecret && !$is2faAuthed) {
|
||||
return redirect(route('two-factor'));
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ class RedirectIfTwoFactorAuthenticated
|
||||
{
|
||||
if (Auth::guard($guard)->check()) {
|
||||
|
||||
$twoFactorAuthEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
||||
$hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
|
||||
$isTwoFactorAuthenticated = Session::get('twofactor-authenticated');
|
||||
if ($twoFactorAuthEnabled && $hasTwoFactorAuthSecret && $isTwoFactorAuthenticated) {
|
||||
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
||||
$has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
|
||||
$is2faAuthed = Session::get('twofactor-authenticated');
|
||||
if ($is2faEnabled && $has2faSecret && $is2faAuthed) {
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user