mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-20 03:10:57 +00:00
Demo user cannot enable two factor auth.
This commit is contained in:
@@ -108,7 +108,7 @@ class HomeController extends Controller
|
|||||||
$journal->save();
|
$journal->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Session::forget(['start','end','viewRange','range','is_custom_range']);
|
Session::forget(['start', 'end', 'viewRange', 'range', 'is_custom_range']);
|
||||||
|
|
||||||
Session::clear();
|
Session::clear();
|
||||||
Artisan::call('cache:clear');
|
Artisan::call('cache:clear');
|
||||||
|
@@ -166,6 +166,9 @@ class PreferencesController extends Controller
|
|||||||
Preferences::set('transactionPageSize', 50);
|
Preferences::set('transactionPageSize', 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$twoFactorAuthEnabled = false;
|
||||||
|
$hasTwoFactorAuthSecret = false;
|
||||||
|
if (!auth()->user()->hasRole('demo')) {
|
||||||
// two factor auth
|
// two factor auth
|
||||||
$twoFactorAuthEnabled = intval($request->get('twoFactorAuthEnabled'));
|
$twoFactorAuthEnabled = intval($request->get('twoFactorAuthEnabled'));
|
||||||
$hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
|
$hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
|
||||||
@@ -174,6 +177,7 @@ class PreferencesController extends Controller
|
|||||||
if ($hasTwoFactorAuthSecret) {
|
if ($hasTwoFactorAuthSecret) {
|
||||||
Preferences::set('twoFactorAuthEnabled', $twoFactorAuthEnabled);
|
Preferences::set('twoFactorAuthEnabled', $twoFactorAuthEnabled);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// language:
|
// language:
|
||||||
$lang = $request->get('language');
|
$lang = $request->get('language');
|
||||||
|
Reference in New Issue
Block a user