mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Demo user cannot enable two factor auth.
This commit is contained in:
parent
8f6a271cc0
commit
48209d0d22
@ -108,7 +108,7 @@ class HomeController extends Controller
|
||||
$journal->save();
|
||||
}
|
||||
}
|
||||
Session::forget(['start','end','viewRange','range','is_custom_range']);
|
||||
Session::forget(['start', 'end', 'viewRange', 'range', 'is_custom_range']);
|
||||
|
||||
Session::clear();
|
||||
Artisan::call('cache:clear');
|
||||
|
@ -166,13 +166,17 @@ class PreferencesController extends Controller
|
||||
Preferences::set('transactionPageSize', 50);
|
||||
}
|
||||
|
||||
// two factor auth
|
||||
$twoFactorAuthEnabled = intval($request->get('twoFactorAuthEnabled'));
|
||||
$hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
|
||||
$twoFactorAuthEnabled = false;
|
||||
$hasTwoFactorAuthSecret = false;
|
||||
if (!auth()->user()->hasRole('demo')) {
|
||||
// two factor auth
|
||||
$twoFactorAuthEnabled = intval($request->get('twoFactorAuthEnabled'));
|
||||
$hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
|
||||
|
||||
// If we already have a secret, just set the two factor auth enabled to 1, and let the user continue with the existing secret.
|
||||
if ($hasTwoFactorAuthSecret) {
|
||||
Preferences::set('twoFactorAuthEnabled', $twoFactorAuthEnabled);
|
||||
// If we already have a secret, just set the two factor auth enabled to 1, and let the user continue with the existing secret.
|
||||
if ($hasTwoFactorAuthSecret) {
|
||||
Preferences::set('twoFactorAuthEnabled', $twoFactorAuthEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
// language:
|
||||
|
Loading…
Reference in New Issue
Block a user