fixed so animation starts as soon as one pushes the button and animation stops if login failed

pull/12939/head
Patrick O'Carroll 7 years ago
parent 8877200ef4
commit 050902a1e7
  1. 27
      public/app/core/controllers/login_ctrl.ts

@ -102,22 +102,27 @@ export class LoginCtrl {
$scope.login = function() {
delete $scope.loginError;
$scope.loggingIn = true;
if (!$scope.loginForm.$valid) {
return;
}
backendSrv.post('/login', $scope.formModel).then(function(result) {
$scope.result = result;
if ($scope.formModel.password !== 'admin' || $scope.ldapEnabled || $scope.authProxyEnabled) {
$scope.loggingIn = true;
$scope.toGrafana();
return;
} else {
$scope.changeView();
}
});
backendSrv
.post('/login', $scope.formModel)
.then(function(result) {
$scope.result = result;
if ($scope.formModel.password !== 'admin' || $scope.ldapEnabled || $scope.authProxyEnabled) {
$scope.toGrafana();
return;
} else {
$scope.changeView();
}
})
.catch(() => {
$scope.loggingIn = false;
});
};
$scope.toGrafana = function() {

Loading…
Cancel
Save