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;
}
function logout(callback) {
accessToken = "invalid";
loggingIn = false;
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 logout(redirect) {
redirect = redirect || window.location.href;
window.location.href = ideBaseUrl + "/auth/signout?redirect=" + encodeURIComponent(redirect);
}
function createLoopDetector(count, duration) {

Wyświetl plik

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