You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by "necouchman (via GitHub)" <gi...@apache.org> on 2026/08/06 19:09:30 UTC

Re: [PR] GUACAMOLE-808: Add page redirection on login [guacamole-client]

necouchman commented on code in PR #1233:
URL: https://github.com/apache/guacamole-client/pull/1233#discussion_r3731272674


##########
guacamole/src/main/java/org/apache/guacamole/GuacamoleSession.java:
##########
@@ -123,6 +129,32 @@ public void setAuthenticatedUser(AuthenticatedUser authenticatedUser) {
         this.authenticatedUser = authenticatedUser;
     }
 
+    /**
+     * Returns a redirection path for newly authenticated users, allowing
+     * redirection to where they left off when an authentication was
+     * requested.
+     *
+     * @return
+     *      A String with the redirection path
+     */
+    public String getRedirection() {
+        this.access();
+        return this.redirection;
+    }
+
+    /**
+     * Returns a redirection path for newly authenticated users, allowing
+     * redirection to where they left off when an authentication was
+     * requested.

Review Comment:
   I think this is copy-pasta - this should be something like `Sets a redirection patch for newly-authenticated users...`



##########
guacamole/src/main/java/org/apache/guacamole/GuacamoleSession.java:
##########
@@ -123,6 +129,32 @@ public void setAuthenticatedUser(AuthenticatedUser authenticatedUser) {
         this.authenticatedUser = authenticatedUser;
     }
 
+    /**
+     * Returns a redirection path for newly authenticated users, allowing
+     * redirection to where they left off when an authentication was
+     * requested.
+     *
+     * @return
+     *      A String with the redirection path

Review Comment:
   ...`or null if no such path is set`?



##########
guacamole/src/main/frontend/src/app/index/controllers/indexController.js:
##########
@@ -328,13 +328,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
     $scope.reAuthenticate = function reAuthenticate() {
 
         $scope.reAuthenticating = true;
-
-        // Clear out URL state to conveniently bring user back to home screen
-        // upon relogin
-        if ($location.path() !== '/')
-            $location.url('/');
-        else
-            $route.reload();
+        $route.reload();

Review Comment:
   Is this change going to adversely impact situations where SSO is not in use and where the behavior of the redirection back to the home screen actually would be expected? For example, configurations where JDBC is the only provider in use, and the re-authentication gets triggered?



##########
guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AuthenticatedUser.java:
##########
@@ -75,4 +75,14 @@ public interface AuthenticatedUser extends Identifiable {
      */
     void invalidate();
 
+    /**
+     * A function to set the originalUri value
+     */
+    public void setOriginalUri(String originalUri);
+
+    /**
+     * A function to get the originalUri value
+     */
+    public String getOriginalUri();

Review Comment:
   This should be properly documented, with the `@return` JSDoc flag.



##########
extensions/guacamole-auth-sso/modules/guacamole-auth-sso-openid/src/main/java/org/apache/guacamole/auth/openid/AuthenticationProviderService.java:
##########
@@ -121,12 +155,24 @@ public SSOAuthenticatedUser authenticateUser(Credentials credentials)
 
     @Override
     public URI getLoginURI() throws GuacamoleException {
+        return getLoginURI(null);
+    }
+
+    private URI getLoginURI(Credentials credentials) throws GuacamoleException {

Review Comment:
   This method needs documentation.



##########
guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AuthenticatedUser.java:
##########
@@ -75,4 +75,14 @@ public interface AuthenticatedUser extends Identifiable {
      */
     void invalidate();
 
+    /**
+     * A function to set the originalUri value
+     */
+    public void setOriginalUri(String originalUri);

Review Comment:
   Please add the `@param` JSDoc flag for the `originalUri` parameter.



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org