GUAC-1126: Query home page directly when logging in. Do not rely on redirect from '/'.

This commit is contained in:
Michael Jumper
2015-04-06 14:33:33 -07:00
parent 9c7e98c97e
commit ca8379d938

View File

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