kopia lustrzana https://github.com/c9/core
logout redirects
rodzic
ef5af704cd
commit
15a3ed02ba
|
@ -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) {
|
||||||
|
|
|
@ -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();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue