GUAC-1126: Automatically invalidate any existing token upon login.

This commit is contained in:
Michael Jumper
2015-04-07 12:23:33 -07:00
parent 5f243c42df
commit 360ec0929e
2 changed files with 70 additions and 12 deletions

View File

@@ -49,11 +49,11 @@ angular.module('login').controller('loginController', ['$scope', '$injector',
*/
$scope.login = function login() {
// Attempt login
// Attempt login once existing session is destroyed
authenticationService.login($scope.username, $scope.password)
// Redirect to main view upon success
.success(function success(data, status, headers, config) {
.then(function loginSuccessful() {
// Provide user with clean environment
guacClientManager.clear();
@@ -67,7 +67,7 @@ angular.module('login').controller('loginController', ['$scope', '$injector',
})
// Reset and focus password upon failure
.error(function error(data, status, headers, config) {
['catch'](function loginFailed() {
$scope.loginError = true;
$scope.passwordFocused = true;
$scope.password = '';