feat(ux): Redirect from init/admin to home when admin already exists (#2340)
Fixes #1853pull/2372/merge
parent
c5aecfe6f3
commit
d6ba46ed7f
|
@ -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();
|
||||
}]);
|
||||
|
|
Loading…
Reference in New Issue