mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 03:17:38 -02:30
Login
Attempted fix for https://trello.com/c/dcu8BoSa/307-401-error-on-login
This commit is contained in:
@@ -23,8 +23,9 @@ function Authenticate($log, $cookieStore, $compile, $window, $scope, $rootScope,
|
|||||||
loginAgain = function() {
|
loginAgain = function() {
|
||||||
Authorization.logout();
|
Authorization.logout();
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
//$location.url('/logout');
|
||||||
window.location = '/#/logout'; // if we get here, force user back to re-login
|
window.location = '/#/logout'; // if we get here, force user back to re-login
|
||||||
}, 500);
|
}, 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
scope.sessionExpired = (Empty($rootScope.sessionExpired)) ? $cookieStore.get('sessionExpired') : $rootScope.sessionExpired;
|
scope.sessionExpired = (Empty($rootScope.sessionExpired)) ? $cookieStore.get('sessionExpired') : $rootScope.sessionExpired;
|
||||||
@@ -152,6 +153,7 @@ function Authenticate($log, $cookieStore, $compile, $window, $scope, $rootScope,
|
|||||||
scope.$emit('AuthorizationGetLicense');
|
scope.$emit('AuthorizationGetLicense');
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
|
Authorization.logout();
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
Alert('Error', 'Failed to access user information. GET returned status: ' + status, 'alert-danger', loginAgain);
|
Alert('Error', 'Failed to access user information. GET returned status: ' + status, 'alert-danger', loginAgain);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -58,15 +58,13 @@ angular.module('AuthService', ['ngCookies', 'Utilities'])
|
|||||||
// should prevent content flash from the prior user.
|
// should prevent content flash from the prior user.
|
||||||
var scope = angular.element(document.getElementById('main-view')).scope();
|
var scope = angular.element(document.getElementById('main-view')).scope();
|
||||||
scope.$destroy();
|
scope.$destroy();
|
||||||
$rootScope.$destroy();
|
//$rootScope.$destroy();
|
||||||
$cookieStore.remove('token_expires');
|
$cookieStore.remove('token_expires');
|
||||||
$cookieStore.remove('current_user');
|
$cookieStore.remove('current_user');
|
||||||
$cookieStore.remove('lastPath');
|
$cookieStore.remove('lastPath');
|
||||||
$cookieStore.remove('lastPath', '/home');
|
|
||||||
$cookieStore.remove('token');
|
$cookieStore.remove('token');
|
||||||
$cookieStore.put('userLoggedIn', false);
|
$cookieStore.put('userLoggedIn', false);
|
||||||
$cookieStore.put('sessionExpired', false);
|
$cookieStore.put('sessionExpired', false);
|
||||||
$cookieStore.put('token', '');
|
|
||||||
$cookieStore.put('current_user', {});
|
$cookieStore.put('current_user', {});
|
||||||
$rootScope.current_user = {};
|
$rootScope.current_user = {};
|
||||||
$rootScope.license_tested = undefined;
|
$rootScope.license_tested = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user