Prevent user from getting locked out without 2fa setup

This commit is contained in:
Johannes Zellner
2022-02-22 11:13:03 +01:00
parent 0dfd217a86
commit c93dde5265
2 changed files with 5 additions and 1 deletions

View File

@@ -856,6 +856,9 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
},
submit: function () {
// prevent the current user from getting locked out
if ($scope.profileConfig.mandatory2FA && !$scope.userImport.twoFactorAuthenticationEnabled) return Client.notify('', $translate.instant('users.settings.require2FAWarning'), true, 'error', '#/profile');
$scope.profileConfig.error = '';
$scope.profileConfig.busy = true;
$scope.profileConfig.success = false;