Move 2fa reset into user edit dialog

This commit is contained in:
Johannes Zellner
2021-09-16 13:21:55 +02:00
parent e0d7238a10
commit 14478919e6
3 changed files with 16 additions and 2 deletions

View File

@@ -228,6 +228,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.useredit = {
busy: false,
reset2FABusy: false,
error: {},
userInfo: {},
@@ -308,6 +309,17 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$('#userEditModal').modal('hide');
});
});
},
reset2FA: function () {
$scope.useredit.reset2FABusy = true;
Client.disableTwoFactorAuthenticationByUserId($scope.useredit.userInfo.id, function (error) {
if (error) return console.error(error);
$scope.useredit.reset2FABusy = false;
$scope.useredit.userInfo.twoFactorAuthenticationEnabled = false;
});
}
};