fix(auth): prevent redirect parameter to use state portainer.auth (#2701)

pull/2745/head
linquize 2019-02-25 08:57:11 +08:00 committed by Anthony Lapenna
parent 9c4c782a90
commit da44f14e07
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ function initAuthentication(authManager, Authentication, $rootScope, $state) {
// authManager.redirectWhenUnauthenticated() + unauthenticatedRedirector
// to have more controls on which URL should trigger the unauthenticated state.
$rootScope.$on('unauthenticated', function (event, data) {
if (!_.includes(data.config.url, '/v2/')) {
if (!_.includes(data.config.url, '/v2/') && ($state.current.name !== 'portainer.auth')) {
$state.go('portainer.auth', {error: 'Your session has expired', redirect: $state.current.name});
}
});