Skip to content

Commit

Permalink
PT-812: Prevent working with expired password (#2199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Egis committed Apr 1, 2021
1 parent 3220705 commit ba46fd8
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -176,8 +176,8 @@ angular.module('platformWebApp')
};
}])

.run(['$rootScope', 'platformWebApp.mainMenuService', 'platformWebApp.metaFormsService', 'platformWebApp.widgetService', '$state', 'platformWebApp.authService',
function ($rootScope, mainMenuService, metaFormsService, widgetService, $state, authService) {
.run(['$transitions', 'platformWebApp.mainMenuService', 'platformWebApp.metaFormsService', 'platformWebApp.widgetService', '$state', 'platformWebApp.authService',
function ($transitions, mainMenuService, metaFormsService, widgetService, $state, authService) {
//Register module in main menu
var menuItem = {
path: 'configuration/security',
Expand Down Expand Up @@ -238,4 +238,11 @@ angular.module('platformWebApp')
controller: 'platformWebApp.accountApiWidgetController',
template: '$(Platform)/Scripts/app/security/widgets/accountApiWidget.tpl.html',
}, 'accountDetail');

// Prevent transition to workspace if password expired
$transitions.onBefore({ to: 'workspace.**' }, function (transition) {
if (authService.isAuthenticated && authService.passwordExpired) {
return transition.router.stateService.target('changePasswordDialog');
}
});
}]);

0 comments on commit ba46fd8

Please sign in to comment.