mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-16 01:47:30 +01:00
fix session token/cookie handling for arbitrary server IPs; fix realtime update distribution via websockets
This commit is contained in:
@@ -16,7 +16,8 @@ module.exports = (req, res, next) => {
|
||||
else db.User.findOne({where: {_id: session.user_id}})
|
||||
.then(user => {
|
||||
if (!user) {
|
||||
res.clearCookie('sdsession');
|
||||
var domain = (process.env.NODE_ENV == "production") ? new URL(config.get('endpoint')).hostname : req.headers.hostname;
|
||||
res.clearCookie('sdsession', { domain: domain });
|
||||
|
||||
if (req.accepts("text/html")) {
|
||||
res.send("Please clear your cookies and try again.");
|
||||
|
||||
Reference in New Issue
Block a user