Store the preAuthUrl on rootScope instead of in the cookie

This commit is contained in:
Michael Abashian
2017-06-09 09:20:49 -04:00
parent cfc15dab37
commit 555c1dcb88
2 changed files with 3 additions and 3 deletions

View File

@@ -365,7 +365,7 @@ var tower = angular.module('Tower', [
if (!Authorization.getToken() || !Authorization.isUserLoggedIn()) { if (!Authorization.getToken() || !Authorization.isUserLoggedIn()) {
// User not authenticated, redirect to login page // User not authenticated, redirect to login page
if (!/^\/(login|logout)/.test($location.path())) { if (!/^\/(login|logout)/.test($location.path())) {
$cookies.put('preAuthUrl', $location.path()); $rootScope.preAuthUrl = $location.path();
} }
$location.path('/login'); $location.path('/login');
} else { } else {

View File

@@ -88,7 +88,7 @@ export default ['$log', '$cookies', '$compile', '$rootScope',
} }
}; };
preAuthUrl = $cookies.get('preAuthUrl'); preAuthUrl = $rootScope.preAuthUrl;
$log.debug('User session expired: ' + sessionExpired); $log.debug('User session expired: ' + sessionExpired);
$log.debug('Last URL: ' + lastPath()); $log.debug('Last URL: ' + lastPath());
@@ -116,7 +116,7 @@ export default ['$log', '$cookies', '$compile', '$rootScope',
Wait("stop"); Wait("stop");
if(!Empty(preAuthUrl)){ if(!Empty(preAuthUrl)){
$location.path(preAuthUrl); $location.path(preAuthUrl);
$cookies.remove('preAuthUrl'); delete $rootScope.preAuthUrl;
} }
else { else {
if (lastPath() && lastUser()) { if (lastPath() && lastUser()) {