mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Redirect the user to the link they clicked on after authentication
This commit is contained in:
@@ -364,6 +364,8 @@ 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
|
||||||
|
$rootScope.lastPath = $location.path();
|
||||||
|
$cookies.put('lastPath', $location.path());
|
||||||
$location.path('/login');
|
$location.path('/login');
|
||||||
} else {
|
} else {
|
||||||
var lastUser = $cookies.getObject('current_user'),
|
var lastUser = $cookies.getObject('current_user'),
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ export default
|
|||||||
Store('sessionTime', x);
|
Store('sessionTime', x);
|
||||||
|
|
||||||
if ($cookies.getObject('current_user')) {
|
if ($cookies.getObject('current_user')) {
|
||||||
$rootScope.lastUser = $cookies.getObject('current_user').id;
|
$cookies.put( 'lastUser', $cookies.getObject('current_user').id);
|
||||||
}
|
}
|
||||||
ConfigService.delete();
|
ConfigService.delete();
|
||||||
SocketService.disconnect();
|
SocketService.disconnect();
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ export default ['$log', '$cookies', '$compile', '$rootScope',
|
|||||||
};
|
};
|
||||||
|
|
||||||
lastUser = function(){
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user