diff --git a/app/portainer/services/stateManager.js b/app/portainer/services/stateManager.js index cf36935e0..27a08479c 100644 --- a/app/portainer/services/stateManager.js +++ b/app/portainer/services/stateManager.js @@ -25,6 +25,7 @@ function StateManagerFactory( UI: { dismissedInfoPanels: {}, dismissedInfoHash: '', + timesPasswordChangeSkipped: {}, }, }; @@ -50,13 +51,12 @@ function StateManagerFactory( manager.setPasswordChangeSkipped = function (userID) { state.UI.instanceId = state.UI.instanceId || state.application.instanceId; - state.UI.timesPasswordChangeSkipped = state.UI.timesPasswordChangeSkipped || {}; state.UI.timesPasswordChangeSkipped[userID] = state.UI.timesPasswordChangeSkipped[userID] + 1 || 1; LocalStorage.storeUIState(state.UI); }; manager.resetPasswordChangeSkips = function (userID) { - if (state.UI.timesPasswordChangeSkipped && state.UI.timesPasswordChangeSkipped[userID]) state.UI.timesPasswordChangeSkipped[userID] = 0; + if (state.UI.timesPasswordChangeSkipped[userID]) state.UI.timesPasswordChangeSkipped[userID] = 0; LocalStorage.storeUIState(state.UI); }; diff --git a/app/portainer/views/account/accountController.js b/app/portainer/views/account/accountController.js index 428481b1f..7c02f4c41 100644 --- a/app/portainer/views/account/accountController.js +++ b/app/portainer/views/account/accountController.js @@ -130,7 +130,7 @@ angular.module('portainer.app').controller('AccountController', [ $scope.AuthenticationMethod = data.AuthenticationMethod; if (state.UI.requiredPasswordLength && state.UI.requiredPasswordLength !== data.RequiredPasswordLength) { - StateManager.clearPasswordChangeSkips($scope.userID.toString()); + StateManager.clearPasswordChangeSkips(); } $scope.timesPasswordChangeSkipped =