mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 05:15:25 +02:00
fix(authentication): fix an issue with the --no-auth flag (#2090)
This commit is contained in:
parent
2e0d1f289c
commit
024739f9f1
2 changed files with 14 additions and 11 deletions
|
@ -15,7 +15,7 @@ function ($scope, $state, $transition$, $sanitize, Authentication, UserService,
|
||||||
|
|
||||||
function unauthenticatedFlow() {
|
function unauthenticatedFlow() {
|
||||||
EndpointService.endpoints()
|
EndpointService.endpoints()
|
||||||
.then(function success(data) {
|
.then(function success(endpoints) {
|
||||||
if (endpoints.length === 0) {
|
if (endpoints.length === 0) {
|
||||||
$state.go('portainer.init.endpoint');
|
$state.go('portainer.init.endpoint');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -16,6 +16,8 @@ function ($q, $scope, StateManager, Notifications, Authentication, UserService)
|
||||||
$scope.uiVersion = StateManager.getState().application.version;
|
$scope.uiVersion = StateManager.getState().application.version;
|
||||||
$scope.logo = StateManager.getState().application.logo;
|
$scope.logo = StateManager.getState().application.logo;
|
||||||
|
|
||||||
|
var authenticationEnabled = $scope.applicationState.application.authentication;
|
||||||
|
if (authenticationEnabled) {
|
||||||
var userDetails = Authentication.getUserDetails();
|
var userDetails = Authentication.getUserDetails();
|
||||||
var isAdmin = userDetails.role === 1;
|
var isAdmin = userDetails.role === 1;
|
||||||
$scope.isAdmin = isAdmin;
|
$scope.isAdmin = isAdmin;
|
||||||
|
@ -28,6 +30,7 @@ function ($q, $scope, StateManager, Notifications, Authentication, UserService)
|
||||||
Notifications.error('Failure', err, 'Unable to retrieve user memberships');
|
Notifications.error('Failure', err, 'Unable to retrieve user memberships');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
initView();
|
initView();
|
||||||
}]);
|
}]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue