Hopefully fix cross-domain login issue

This commit is contained in:
calzoneman 2014-02-15 23:17:31 -06:00
parent 638333c345
commit e8daf33146
1 changed files with 14 additions and 0 deletions

View File

@ -44,6 +44,20 @@ function handleLogin(req, res) {
httpOnly: true
});
res.cookie("auth", user.name + ":" + user.hash, {
domain: Config.get("http.domain"),
expires: new Date(Date.now() + 7*24*60*60*1000),
httpOnly: true
});
if (Config.get("https.enabled")) {
res.cookie("auth", user.name + ":" + user.hash, {
domain: Config.get("https.domain"),
expires: new Date(Date.now() + 7*24*60*60*1000),
httpOnly: true
});
}
// Try to find an appropriate redirect
var ref = req.header("referrer");
if (!ref) {