mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03:30
Redirect the user to the link they clicked on after authentication
This commit is contained in:
parent
d3c9b57133
commit
fc312398cd
@ -364,6 +364,8 @@ var tower = angular.module('Tower', [
|
||||
|
||||
if (!Authorization.getToken() || !Authorization.isUserLoggedIn()) {
|
||||
// User not authenticated, redirect to login page
|
||||
$rootScope.lastPath = $location.path();
|
||||
$cookies.put('lastPath', $location.path());
|
||||
$location.path('/login');
|
||||
} else {
|
||||
var lastUser = $cookies.getObject('current_user'),
|
||||
|
||||
@ -103,7 +103,7 @@ export default
|
||||
Store('sessionTime', x);
|
||||
|
||||
if ($cookies.getObject('current_user')) {
|
||||
$rootScope.lastUser = $cookies.getObject('current_user').id;
|
||||
$cookies.put( 'lastUser', $cookies.getObject('current_user').id);
|
||||
}
|
||||
ConfigService.delete();
|
||||
SocketService.disconnect();
|
||||
|
||||
@ -80,7 +80,8 @@ export default ['$log', '$cookies', '$compile', '$rootScope',
|
||||
};
|
||||
|
||||
lastUser = function(){
|
||||
if(!Empty($rootScope.lastUser) && $rootScope.lastUser === $rootScope.current_user.id){
|
||||
let lastUser = $cookies.get('lastUser');
|
||||
if(!Empty(lastUser) && parseInt(lastUser) === $rootScope.current_user.id){
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user