From ca8379d938b56693e8b7244386c0b878746c02c5 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 6 Apr 2015 14:33:33 -0700 Subject: [PATCH] GUAC-1126: Query home page directly when logging in. Do not rely on redirect from '/'. --- .../main/webapp/app/login/controllers/loginController.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guacamole/src/main/webapp/app/login/controllers/loginController.js b/guacamole/src/main/webapp/app/login/controllers/loginController.js index 9f8078733..565abc6c7 100644 --- a/guacamole/src/main/webapp/app/login/controllers/loginController.js +++ b/guacamole/src/main/webapp/app/login/controllers/loginController.js @@ -26,6 +26,7 @@ angular.module('login').controller('loginController', ['$scope', '$injector', // Required services var $location = $injector.get("$location"); var authenticationService = $injector.get("authenticationService"); + var userPageService = $injector.get('userPageService'); /** * Whether an error occurred during login. @@ -52,7 +53,10 @@ angular.module('login').controller('loginController', ['$scope', '$injector', // Redirect to main view upon success .success(function success(data, status, headers, config) { - $location.path('/'); + userPageService.getHomePage() + .then(function homePageRetrieved(homePage) { + $location.url(homePage.url); + }); }) // Reset and focus password upon failure