mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -02: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:
@@ -11,8 +11,8 @@
|
|||||||
* Controller for handling third party supported login options.
|
* Controller for handling third party supported login options.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default ['$window', '$scope', 'thirdPartySignOnService',
|
export default ['$window', '$scope', 'thirdPartySignOnService', '$cookies', 'Authorization',
|
||||||
function ($window, $scope, thirdPartySignOnService) {
|
function ($window, $scope, thirdPartySignOnService, $cookies, Authorization) {
|
||||||
|
|
||||||
thirdPartySignOnService(
|
thirdPartySignOnService(
|
||||||
{scope: $scope, url: "api/v2/auth/"}).then(function (data) {
|
{scope: $scope, url: "api/v2/auth/"}).then(function (data) {
|
||||||
@@ -29,8 +29,16 @@ export default ['$window', '$scope', 'thirdPartySignOnService',
|
|||||||
});
|
});
|
||||||
|
|
||||||
$scope.goTo = function(link) {
|
$scope.goTo = function(link) {
|
||||||
// this is used because $location only lets you navigate inside
|
// clear out any prior auth state that might exist (e.g: from other
|
||||||
// the "/#/" path, and these are API urls.
|
// tabs, etc.) before redirecting to the auth service
|
||||||
$window.location.href = link;
|
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;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user