Some scrutiniser related code cleanup.

This commit is contained in:
James Cole
2016-03-20 16:46:26 +01:00
parent 6698b57f52
commit 6602b1587a
5 changed files with 26 additions and 26 deletions

View File

@@ -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'));
}