This commit is contained in:
James Cole
2017-11-18 16:30:45 +01:00
parent 5f127b7bec
commit e8e0a44cca
11 changed files with 17 additions and 18 deletions

View File

@@ -64,8 +64,8 @@ class AuthenticateTwoFactor
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
// grab 2auth information from cookie, not from session.
$is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated');
// grab 2auth information from session.
$is2faAuthed = true === $request->session()->get('twoFactorAuthenticated');
if ($is2faEnabled && $has2faSecret && !$is2faAuthed) {
Log::debug('Does not seem to be 2 factor authed, redirect.');

View File

@@ -47,8 +47,8 @@ class RedirectIfTwoFactorAuthenticated
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
// grab 2auth information from cookie
$is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated');
// grab 2auth information from session.
$is2faAuthed = true === $request->session()->get('twoFactorAuthenticated');
if ($is2faEnabled && $has2faSecret && $is2faAuthed) {
return redirect('/');