fix(app/account): ensure newTransition exists in uiCanExit [EE-3336] (#7110)

pull/7123/head
LP B 2 years ago committed by GitHub
parent 84611a90a1
commit 58c44ad1ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,11 +48,13 @@ angular.module('portainer.app').controller('AccountController', [
};
this.uiCanExit = (newTransition) => {
if ($scope.userRole === 1 && newTransition && newTransition.to().name === 'portainer.settings.authentication') {
return true;
}
if (newTransition.to().name === 'portainer.logout') {
return true;
if (newTransition) {
if ($scope.userRole === 1 && newTransition.to().name === 'portainer.settings.authentication') {
return true;
}
if (newTransition.to().name === 'portainer.logout') {
return true;
}
}
if ($scope.forceChangePassword) {
ModalService.confirmForceChangePassword();

Loading…
Cancel
Save