logout redirects

pull/223/head
Fabian Jakobs 2015-10-28 14:45:53 +00:00
rodzic ef5af704cd
commit 15a3ed02ba
2 zmienionych plików z 5 dodań i 18 usunięć

Wyświetl plik

@ -107,20 +107,9 @@ define(function(require, exports, module) {
}) || true; }) || true;
} }
function logout(callback) { function logout(redirect) {
accessToken = "invalid"; redirect = redirect || window.location.href;
loggingIn = false; window.location.href = ideBaseUrl + "/auth/signout?redirect=" + encodeURIComponent(redirect);
http.request("/_auth/logout", function(err1) {
http.request(ideBaseUrl + "/auth/signout", {
method: "POST",
withCredentials: true
}, function(err2) {
loggedIn = false;
emit("logout", {uid: uid, newUid: ANONYMOUS});
callback && callback(err1 || err2);
});
});
} }
function createLoopDetector(count, duration) { function createLoopDetector(count, duration) {

Wyświetl plik

@ -137,7 +137,7 @@ define(function(require, exports, module) {
function signout() { function signout() {
vfsEndpoint.clearCache(); vfsEndpoint.clearCache();
auth.logout(function() { location.href = ideBaseUrl; }); auth.logout(ideBaseUrl);
} }
function onReLogin() { function onReLogin() {
@ -147,9 +147,7 @@ define(function(require, exports, module) {
"Please hit OK to reload the IDE.", "Please hit OK to reload the IDE.",
function() { function() {
vfsEndpoint.clearCache(); vfsEndpoint.clearCache();
auth.logout(function() { auth.logout();
document.location.reload();
});
}); });
} }
} }