mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 13:39:27 -02:30
Store the preAuthUrl on rootScope instead of in the cookie
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user