mirror of https://github.com/calzoneman/sync.git
Hopefully fix cross-domain login issue
This commit is contained in:
parent
638333c345
commit
e8daf33146
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue