1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

feat(ux): Redirect from init/admin to home when admin already exists (#2340)

Fixes #1853
This commit is contained in:
Jan Jansen 2018-10-13 08:29:44 +02:00 committed by Anthony Lapenna
parent c5aecfe6f3
commit d6ba46ed7f

View file

@ -41,4 +41,16 @@ function ($scope, $state, Notifications, Authentication, StateManager, UserServi
});
};
function createAdministratorFlow() {
UserService.administratorExists()
.then(function success(exists) {
if (exists) {
$state.go('portainer.home');
}
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to verify administrator account existence');
});
}
createAdministratorFlow();
}]);