mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Merge pull request #8299 from jakemcdermott/fix-8154
Force logout and clear before social auth login
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
https://github.com/jakemcdermott
This commit is contained in:
commit
796a61da86
@ -11,8 +11,8 @@
|
||||
* Controller for handling third party supported login options.
|
||||
*/
|
||||
|
||||
export default ['$window', '$scope', 'thirdPartySignOnService',
|
||||
function ($window, $scope, thirdPartySignOnService) {
|
||||
export default ['$window', '$scope', 'thirdPartySignOnService', '$cookies', 'Authorization',
|
||||
function ($window, $scope, thirdPartySignOnService, $cookies, Authorization) {
|
||||
|
||||
thirdPartySignOnService(
|
||||
{scope: $scope, url: "api/v2/auth/"}).then(function (data) {
|
||||
@ -29,8 +29,16 @@ export default ['$window', '$scope', 'thirdPartySignOnService',
|
||||
});
|
||||
|
||||
$scope.goTo = function(link) {
|
||||
// this is used because $location only lets you navigate inside
|
||||
// the "/#/" path, and these are API urls.
|
||||
$window.location.href = link;
|
||||
// clear out any prior auth state that might exist (e.g: from other
|
||||
// tabs, etc.) before redirecting to the auth service
|
||||
Authorization.logout().then(() => {
|
||||
angular.forEach($cookies.getAll(), (val, name) => {
|
||||
$cookies.remove(name);
|
||||
});
|
||||
$window.location.reload();
|
||||
// this is used because $location only lets you navigate inside
|
||||
// the "/#/" path, and these are API urls.
|
||||
$window.location.href = link;
|
||||
});
|
||||
};
|
||||
}];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user