mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	GUAC-919: Rename LoginRESTService to TokenRESTService and provide logout semantics. Move Angular auth stuff to own module. Actually logout user.
This commit is contained in:
		| @@ -29,7 +29,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector', | ||||
|     // Get the dependencies commonJS style | ||||
|     var permissionDAO           = $injector.get("permissionDAO"), | ||||
|         permissionCheckService  = $injector.get("permissionCheckService"), | ||||
|         localStorageUtility     = $injector.get("localStorageUtility"), | ||||
|         authenticationService   = $injector.get("authenticationService"), | ||||
|         $q                      = $injector.get("$q"), | ||||
|         $document               = $injector.get("$document"), | ||||
|         $window                 = $injector.get("$window"), | ||||
| @@ -64,7 +64,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector', | ||||
|     var permissionsLoaded= $q.defer(); | ||||
|     $scope.basicPermissionsLoaded = permissionsLoaded.promise; | ||||
|      | ||||
|     $scope.currentUserID = localStorageUtility.get('userID'); | ||||
|     $scope.currentUserID = authenticationService.getCurrentUserID(); | ||||
|      | ||||
|     // If the user is unknown, force a login | ||||
|     if(!$scope.currentUserID) | ||||
| @@ -86,6 +86,13 @@ angular.module('index').controller('indexController', ['$scope', '$injector', | ||||
|             permissionsLoaded.resolve(); | ||||
|         }); | ||||
|     }; | ||||
|  | ||||
|     // Provide simple mechanism for logging out the current user | ||||
|     $scope.logout = function logout() { | ||||
|         authenticationService.logout().success(function logoutSuccess() { | ||||
|             $location.path('/login'); | ||||
|         }); | ||||
|     }; | ||||
|      | ||||
|     // Try to load them now | ||||
|     $scope.loadBasicPermissions(); | ||||
|   | ||||
| @@ -23,4 +23,4 @@ | ||||
| /** | ||||
|  * The module for the root of the application. | ||||
|  */ | ||||
| angular.module('index', ['ngRoute', 'pascalprecht.translate', 'home', 'manage', 'login', 'client']); | ||||
| angular.module('index', ['ngRoute', 'pascalprecht.translate', 'auth', 'home', 'manage', 'login', 'client']); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user