mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 15:08:03 -03:30
Fix login and authorization token errors
* Remove extraneous quotes when authroization token is retrieved from a cookie * Fix thrown error when invalid creds are supplied on login due to attempt to access property of an undefined value
This commit is contained in:
parent
9e9692971f
commit
4ad2af30cf
@ -45,7 +45,13 @@ export default
|
||||
},
|
||||
|
||||
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) {
|
||||
@ -101,7 +107,7 @@ export default
|
||||
$rootScope.lastPath = '/home';
|
||||
}
|
||||
x = Store('sessionTime');
|
||||
if ($rootScope.current_user) {
|
||||
if ($rootScope.current_user && x && x[$rootScope.current_user.id]) {
|
||||
x[$rootScope.current_user.id].loggedIn = false;
|
||||
}
|
||||
Store('sessionTime', x);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user