mirror of
https://github.com/ansible/awx.git
synced 2026-04-13 22:19:27 -02:30
Merge pull request #458 from gconsidine/ui/fix/login-auth-token
Fix login and authorization token errors
This commit is contained in:
@@ -45,7 +45,13 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
getToken: function () {
|
getToken: function () {
|
||||||
return ($rootScope.token) ? $rootScope.token : $cookies.get('token');
|
if ($rootScope.token) {
|
||||||
|
return $rootScope.token;
|
||||||
|
}
|
||||||
|
|
||||||
|
let token = $cookies.get('token');
|
||||||
|
|
||||||
|
return token ? token.replace(/"/g, '') : undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
retrieveToken: function (username, password) {
|
retrieveToken: function (username, password) {
|
||||||
@@ -101,7 +107,7 @@ export default
|
|||||||
$rootScope.lastPath = '/home';
|
$rootScope.lastPath = '/home';
|
||||||
}
|
}
|
||||||
x = Store('sessionTime');
|
x = Store('sessionTime');
|
||||||
if ($rootScope.current_user) {
|
if ($rootScope.current_user && x && x[$rootScope.current_user.id]) {
|
||||||
x[$rootScope.current_user.id].loggedIn = false;
|
x[$rootScope.current_user.id].loggedIn = false;
|
||||||
}
|
}
|
||||||
Store('sessionTime', x);
|
Store('sessionTime', x);
|
||||||
|
|||||||
Reference in New Issue
Block a user