mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 02:00:01 -03:30
Portal mode authorization
Had to override the authorization controller which automatically redirects the user to hte home page if it is their first time visiting tower. I perform a check to see if the url is to /portal, and then set lastPath to portal to force it to portal mode on the first visit
This commit is contained in:
@@ -649,6 +649,10 @@ angular.module('Tower', [
|
|||||||
$AnsibleConfig = Store('AnsibleConfig');
|
$AnsibleConfig = Store('AnsibleConfig');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//the authorization controller redirects to the home page automatcially if there is no last path defined. in order to override
|
||||||
|
// this, set the last path to /portal for instances where portal is visited for the first time.
|
||||||
|
$rootScope.lastPath = ($location.path() === "/portal") ? 'portal' : undefined;
|
||||||
|
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -64,7 +64,16 @@ angular.module('AuthService', ['ngCookies', 'Utilities'])
|
|||||||
//$rootScope.$destroy();
|
//$rootScope.$destroy();
|
||||||
$cookieStore.remove('token_expires');
|
$cookieStore.remove('token_expires');
|
||||||
$cookieStore.remove('current_user');
|
$cookieStore.remove('current_user');
|
||||||
$cookieStore.remove('lastPath');
|
|
||||||
|
if($cookieStore.get('lastPath')==='/portal'){
|
||||||
|
$cookieStore.put( 'lastPath', '/portal');
|
||||||
|
$rootScope.lastPath = '/portal';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$cookieStore.remove('lastPath');
|
||||||
|
$rootScope.lastPath = '/home';
|
||||||
|
}
|
||||||
|
|
||||||
$cookieStore.remove('token');
|
$cookieStore.remove('token');
|
||||||
$cookieStore.put('userLoggedIn', false);
|
$cookieStore.put('userLoggedIn', false);
|
||||||
$cookieStore.put('sessionExpired', false);
|
$cookieStore.put('sessionExpired', false);
|
||||||
@@ -75,7 +84,7 @@ angular.module('AuthService', ['ngCookies', 'Utilities'])
|
|||||||
$rootScope.sessionExpired = false;
|
$rootScope.sessionExpired = false;
|
||||||
$rootScope.token = null;
|
$rootScope.token = null;
|
||||||
$rootScope.token_expires = null;
|
$rootScope.token_expires = null;
|
||||||
$rootScope.lastPath = '/home';
|
|
||||||
$rootScope.login_username = null;
|
$rootScope.login_username = null;
|
||||||
$rootScope.login_password = null;
|
$rootScope.login_password = null;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user