From 693182fbd397b53d2017b729f6690f627e79b17d Mon Sep 17 00:00:00 2001 From: xAt0mZ Date: Wed, 10 Jul 2019 18:13:03 +0200 Subject: [PATCH] feat(auth): login spinner (#2999) --- app/portainer/views/auth/auth.html | 5 ++++- app/portainer/views/auth/authController.js | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/portainer/views/auth/auth.html b/app/portainer/views/auth/auth.html index ceba5e6d0..4f1caf491 100644 --- a/app/portainer/views/auth/auth.html +++ b/app/portainer/views/auth/auth.html @@ -43,7 +43,10 @@ - + diff --git a/app/portainer/views/auth/authController.js b/app/portainer/views/auth/authController.js index 840e9a7d8..9e239636f 100644 --- a/app/portainer/views/auth/authController.js +++ b/app/portainer/views/auth/authController.js @@ -23,12 +23,14 @@ function($async, $q, $scope, $state, $stateParams, $sanitize, Authentication, Us await ExtensionService.retrieveAndSaveEnabledExtensions(); } catch (err) { Notifications.error('Failure', err, 'Unable to retrieve enabled extensions'); + $scope.state.loginInProgress = false; } } $scope.authenticateUser = function() { var username = $scope.formValues.Username; var password = $scope.formValues.Password; + $scope.state.loginInProgress = true; Authentication.login(username, password) .then(function success() { @@ -53,6 +55,7 @@ function($async, $q, $scope, $state, $stateParams, $sanitize, Authentication, Us }) .catch(function error() { $scope.state.AuthenticationError = 'Invalid credentials'; + $scope.state.loginInProgress = false; }); }); }; @@ -96,6 +99,7 @@ function($async, $q, $scope, $state, $stateParams, $sanitize, Authentication, Us }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve endpoints'); + $scope.state.loginInProgress = false; }); }