mirror of https://github.com/portainer/portainer
fix(auth): track skips per user [EE-3318] (#7089)
parent
92eaa02156
commit
ae731b5496
|
@ -25,6 +25,7 @@ function StateManagerFactory(
|
||||||
UI: {
|
UI: {
|
||||||
dismissedInfoPanels: {},
|
dismissedInfoPanels: {},
|
||||||
dismissedInfoHash: '',
|
dismissedInfoHash: '',
|
||||||
|
timesPasswordChangeSkipped: {},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,13 +51,12 @@ function StateManagerFactory(
|
||||||
|
|
||||||
manager.setPasswordChangeSkipped = function (userID) {
|
manager.setPasswordChangeSkipped = function (userID) {
|
||||||
state.UI.instanceId = state.UI.instanceId || state.application.instanceId;
|
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;
|
state.UI.timesPasswordChangeSkipped[userID] = state.UI.timesPasswordChangeSkipped[userID] + 1 || 1;
|
||||||
LocalStorage.storeUIState(state.UI);
|
LocalStorage.storeUIState(state.UI);
|
||||||
};
|
};
|
||||||
|
|
||||||
manager.resetPasswordChangeSkips = function (userID) {
|
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);
|
LocalStorage.storeUIState(state.UI);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ angular.module('portainer.app').controller('AccountController', [
|
||||||
$scope.AuthenticationMethod = data.AuthenticationMethod;
|
$scope.AuthenticationMethod = data.AuthenticationMethod;
|
||||||
|
|
||||||
if (state.UI.requiredPasswordLength && state.UI.requiredPasswordLength !== data.RequiredPasswordLength) {
|
if (state.UI.requiredPasswordLength && state.UI.requiredPasswordLength !== data.RequiredPasswordLength) {
|
||||||
StateManager.clearPasswordChangeSkips($scope.userID.toString());
|
StateManager.clearPasswordChangeSkips();
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.timesPasswordChangeSkipped =
|
$scope.timesPasswordChangeSkipped =
|
||||||
|
|
Loading…
Reference in New Issue