This commit is contained in:
calzoneman 2014-03-01 17:37:59 -06:00
parent b96b488c22
commit 341d17c7b9
6 changed files with 22 additions and 14 deletions

View file

@ -611,14 +611,14 @@ function handlePasswordReset(req, res) {
Logger.errlog.log("mail fail: " + err);
sendJade(res, "account-passwordreset", {
reset: false,
resetEmail: user.email,
resetEmail: email,
resetErr: "Sending reset email failed. Please contact an " +
"administrator for assistance."
});
} else {
sendJade(res, "account-passwordreset", {
reset: true,
resetEmail: user.email,
resetEmail: email,
resetErr: false
});
}

View file

@ -42,14 +42,15 @@ function handleLogin(req, res) {
});
} else {
var auth = user.name + ":" + user.hash;
console.log(Config.get("http.root-domain-dotted"));
res.cookie("auth", auth, {
domain: "." + Config.get("http.root-domain"),
domain: Config.get("http.root-domain-dotted"),
expires: new Date(Date.now() + 7*24*60*60*1000),
httpOnly: true
});
res.cookie("rank", user.global_rank, {
domain: "." + Config.get("http.root-domain"),
domain: Config.get("http.root-domain-dotted"),
expires: new Date(Date.now() + 7*24*60*60*1000),
});
@ -140,8 +141,8 @@ function handleShimLogout(req, res) {
res.clearCookie("auth");
res.clearCookie("rank");
res.clearCookie("auth", { domain: "." + Config.get("http.root-domain") });
res.clearCookie("rank", { domain: "." + Config.get("http.root-domain") });
res.clearCookie("auth", { domain: Config.get("http.root-domain-dotted") });
res.clearCookie("rank", { domain: Config.get("http.root-domain-dotted") });
if (redirect.match(/login|logout/)) {
@ -198,8 +199,8 @@ function handleLogout(req, res) {
var host = req.host;
if (host.indexOf(Config.get("http.root-domain")) !== -1) {
res.clearCookie("auth", { domain: Config.get("http.root-domain") });
res.clearCookie("rank", { domain: Config.get("http.root-domain") });
res.clearCookie("auth", { domain: Config.get("http.root-domain-dotted") });
res.clearCookie("rank", { domain: Config.get("http.root-domain-dotted") });
} else {
var dest = Config.get("http.full-address") + "/shimlogout?redirect=" +
encodeURIComponent(ref);