From e8daf3314618894b79ca164e3fe37cebff367006 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sat, 15 Feb 2014 23:17:31 -0600 Subject: [PATCH] Hopefully fix cross-domain login issue --- lib/web/auth.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/web/auth.js b/lib/web/auth.js index 98f03a10..937bbd91 100644 --- a/lib/web/auth.js +++ b/lib/web/auth.js @@ -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) {