mike-jumper commented on a change in pull request #346: GUACAMOLE-680: 
Rearrange logout handling
URL: https://github.com/apache/guacamole-client/pull/346#discussion_r357946524
 
 

 ##########
 File path: guacamole/src/main/webapp/app/auth/service/authenticationService.js
 ##########
 @@ -290,13 +290,20 @@ angular.module('auth').factory('authenticationService', 
['$injector',
         var token = service.getCurrentToken();
         clearAuthenticationResult();
 
-        // Notify listeners that a token is being destroyed
-        $rootScope.$broadcast('guacLogout', token);
+        // Notify listeners that a token is about to be destroyed
+        $rootScope.$broadcast('beforeGuacLogout', token);
 
 Review comment:
   For sake of compatibility, I think it would be better to:
   
   * Leave `guacLogout` as-is (but update any existing documentation if 
incorrect)
   * Let the new event be the one with a new name, presumably `guacAfterLogout` 
or `guacLogoutSuccess` for consistency with established namespacing.
   
   As for the event itself, there may be more to be done here. As discovered in 
#455, the way the interface currently handles automatic reauthentication upon 
logout causes trouble and cannot currently be prevented. Leveraging this new 
event and checking `defaultPrevented` to determine whether to reauthenticate 
after logout could solve things. Extensions like CAS and OpenID could simply 
`$scope.$on('guacLogoutSuccess', ...)`, and then `preventDefault()` and 
redirect using `$location` within their handler.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to