Fix cross-domain cookie issue

This commit is contained in:
calzoneman 2014-02-26 10:50:59 -06:00
parent ced68d9304
commit 93d5980f05
7 changed files with 31 additions and 7 deletions

View file

@ -445,6 +445,20 @@ Callbacks = {
if (!CLIENT.guest) {
socket.emit("initUserPLCallbacks");
var logoutform = $("<p/>").attr("id", "logoutform")
.addClass("navbar-text pull-right")
.insertAfter($("#loginform"));
$("<span/>").attr("id", "welcome").text("Welcome, " + CLIENT.name)
.appendTo(logoutform);
$("<span/>").html("&nbsp;&middot;&nbsp;").appendTo(logoutform);
var domain = $("#loginform").attr("action").replace("/login", "");
$("<a/>").attr("id", "logout")
.attr("href", domain + "/logout?redirect=/r/" + CHANNEL.name)
.text("Logout")
.appendTo(logoutform);
$("#loginform").remove();
}
}
},