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

Fixes #1853
pull/2372/merge
Jan Jansen 2018-10-13 08:29:44 +02:00 committed by Anthony Lapenna
parent c5aecfe6f3
commit d6ba46ed7f
1 changed files with 12 additions and 0 deletions

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();
}]);