mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Fixes 2FA cookie -> user issue
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
321be4733d
commit
f878e0ad66
|
@ -363,7 +363,7 @@ class LoginController extends Controller
|
|||
if (Google2FA::verifyKey($user->two_factor_secret, $secret)) {
|
||||
$user->two_factor_enrolled = 1;
|
||||
$user->save();
|
||||
$request->session()->put('2fa_authed', 'true');
|
||||
$request->session()->put('2fa_authed', $user->id);
|
||||
return redirect()->route('home')->with('success', 'You are logged in!');
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class CheckForTwoFactor
|
|||
if ($settings = Setting::getSettings()) {
|
||||
if (Auth::check() && ($settings->two_factor_enabled != '')) {
|
||||
// This user is already 2fa-authed
|
||||
if ($request->session()->get('2fa_authed')) {
|
||||
if ($request->session()->get('2fa_authed')==Auth::user()->id) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue