mirror of https://github.com/portainer/portainer
parent
9cbf1f34a7
commit
1eb7e6bacc
|
@ -44,8 +44,8 @@ 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/') && ($state.current.name !== 'portainer.auth')) {
|
||||
$state.go('portainer.auth', {error: 'Your session has expired', redirect: $state.current.name});
|
||||
if (!_.includes(data.config.url, '/v2/')) {
|
||||
$state.go('portainer.auth', { error: 'Your session has expired' });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ angular.module('portainer.app', [])
|
|||
|
||||
var authentication = {
|
||||
name: 'portainer.auth',
|
||||
url: '/auth?redirect',
|
||||
url: '/auth',
|
||||
params: {
|
||||
logout: false,
|
||||
error: ''
|
||||
|
@ -329,7 +329,7 @@ angular.module('portainer.app', [])
|
|||
}
|
||||
},
|
||||
resolve: {
|
||||
endpointID: ['EndpointProvider', '$state',
|
||||
endpointID: ['EndpointProvider', '$state',
|
||||
function (EndpointProvider, $state) {
|
||||
var id = EndpointProvider.endpointID();
|
||||
if (!id) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
angular.module('portainer.app')
|
||||
.controller('AuthenticationController', ['$q', '$scope', '$state', '$transition$', '$sanitize', 'Authentication', 'UserService', 'EndpointService', 'StateManager', 'Notifications', 'SettingsService', '$stateParams',
|
||||
function ($q, $scope, $state, $transition$, $sanitize, Authentication, UserService, EndpointService, StateManager, Notifications, SettingsService, $stateParams) {
|
||||
.controller('AuthenticationController', ['$q', '$scope', '$state', '$transition$', '$sanitize', 'Authentication', 'UserService', 'EndpointService', 'StateManager', 'Notifications', 'SettingsService',
|
||||
function ($q, $scope, $state, $transition$, $sanitize, Authentication, UserService, EndpointService, StateManager, Notifications, SettingsService) {
|
||||
|
||||
$scope.logo = StateManager.getState().application.logo;
|
||||
|
||||
|
@ -44,7 +44,7 @@ function ($q, $scope, $state, $transition$, $sanitize, Authentication, UserServi
|
|||
if (endpoints.length === 0) {
|
||||
$state.go('portainer.init.endpoint');
|
||||
} else {
|
||||
$state.go($stateParams.redirect ||'portainer.home');
|
||||
$state.go('portainer.home');
|
||||
}
|
||||
})
|
||||
.catch(function error(err) {
|
||||
|
@ -73,7 +73,7 @@ function ($q, $scope, $state, $transition$, $sanitize, Authentication, UserServi
|
|||
if (endpoints.length === 0 && userDetails.role === 1) {
|
||||
$state.go('portainer.init.endpoint');
|
||||
} else {
|
||||
$state.go($stateParams.redirect || 'portainer.home');
|
||||
$state.go('portainer.home');
|
||||
}
|
||||
})
|
||||
.catch(function error(err) {
|
||||
|
|
Loading…
Reference in New Issue