diff options
Diffstat (limited to 'static/js/loginController.js')
| -rw-r--r-- | static/js/loginController.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/static/js/loginController.js b/static/js/loginController.js deleted file mode 100644 index f2168ba..0000000 --- a/static/js/loginController.js +++ /dev/null @@ -1,39 +0,0 @@ -angular.module('Authentication').controller('LoginController', [ - '$scope', '$rootScope', '$location', '$state', 'AuthenticationService', - function($scope, $rootScope, $location, $state, AuthenticationService) { - if (AuthenticationService.IsLoggedIn()) { - if (typeof $state.after_login_state === 'undefined') { - $state.after_login_state = 'systeminfo'; - } - $state.go($state.after_login_state); - delete $state.after_login_state; - } - $scope.logoutreason = AuthenticationService.logoutreason; - - $scope.login = function() { - $scope.dataLoading = true; - AuthenticationService.Login($scope.username, $scope.password) - .then( - function(response) { - AuthenticationService.SetCredentials($scope.username, - response.data.token); - if (typeof $state.after_login_state === 'undefined') { - $state.after_login_state = 'systeminfo'; - } - $state.go($state.after_login_state); - delete $state.after_login_state; - - }, - function(response) { - if (response.status === 401) { - // reset login status - AuthenticationService.ClearCredentials( - 'Username or Password is incorrect'); - } - $scope.logoutreason = AuthenticationService.logoutreason; - $scope.error = response.message; - $scope.dataLoading = false; - }); - }; - } -]); |

