-
-
|
+
| + |
+
+ +
|
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/twofactor/configuretwofactor.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/twofactor/configuretwofactor.controller.js
index 382d9ef35e..d1175e7e7f 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/twofactor/configuretwofactor.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/twofactor/configuretwofactor.controller.js
@@ -54,19 +54,49 @@ angular.module("umbraco").controller("Umbraco.Editors.ConfigureTwoFactorControll
}
function disable(provider) {
+ if ($scope.model.isCurrentUser) {
+ const disableTwoFactorSettings = {
+ provider,
+ user: vm.user,
+ size: "small",
+ view: "views/common/infiniteeditors/twofactor/disabletwofactor.html",
+ close: function () {
+ editorService.close();
+ onInit();
+ }
+ };
- const disableTwoFactorSettings = {
- provider,
- user: vm.user,
- size: "small",
- view: "views/common/infiniteeditors/twofactor/disabletwofactor.html",
- close: function () {
- editorService.close();
- onInit();
- }
- };
+ editorService.open(disableTwoFactorSettings);
+ } else {
+ localizationService.localize("user_2faDisableForUser").then(function (value) {
+ const removeOverlay = {
+ content: value,
+ submitButtonLabelKey: 'actions_disable',
+ submit: function ({ close }) {
+ twoFactorLoginResource.disable(provider.providerName, $scope.model.user.key)
+ .then(onResponse)
+ .catch(onError);
- editorService.open(disableTwoFactorSettings);
+ close();
+ }
+ };
+
+ overlayService.confirmRemove(removeOverlay);
+ });
+ }
+ }
+
+ function onResponse(response) {
+ if (response) {
+ localizationService.localize("user_2faProviderIsDisabledMsg").then(function (value) {
+ notificationsService.info(value);
+ });
+ onInit();
+ } else {
+ localizationService.localize("user_2faProviderIsNotDisabledMsg").then(function (value) {
+ notificationsService.error(value);
+ });
+ }
}
function onError(error) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/twofactor/configuretwofactor.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/twofactor/configuretwofactor.html
index 15bb70b7f9..cc25439bb9 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/twofactor/configuretwofactor.html
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/twofactor/configuretwofactor.html
@@ -21,15 +21,9 @@
Don't worry - no content will be deleted and everything will continue working afterwards!
- ]]> + ]]>| - |
-
- -
|