Demo user cannot enable two factor auth.

This commit is contained in:
James Cole
2016-12-26 08:57:07 +01:00
parent 8f6a271cc0
commit 48209d0d22
2 changed files with 11 additions and 7 deletions

View File

@@ -166,6 +166,9 @@ class PreferencesController extends Controller
Preferences::set('transactionPageSize', 50);
}
$twoFactorAuthEnabled = false;
$hasTwoFactorAuthSecret = false;
if (!auth()->user()->hasRole('demo')) {
// two factor auth
$twoFactorAuthEnabled = intval($request->get('twoFactorAuthEnabled'));
$hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
@@ -174,6 +177,7 @@ class PreferencesController extends Controller
if ($hasTwoFactorAuthSecret) {
Preferences::set('twoFactorAuthEnabled', $twoFactorAuthEnabled);
}
}
// language:
$lang = $request->get('language');