Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@ export function createApp() {
cookie: {
httpOnly: true,

// ✅ must be true when sameSite is "none"
secure: isProd,
// ✅ must be true when sameSite is "none"
secure: isProd,

sameSite: cookieSameSite,
sameSite: "none",

// ✅ allow cookie across root + api subdomain (prod only)
domain: isProd ? ".thehumanpatternlab.com" : undefined,
// ✅ allow cookie across root + api subdomain (prod only)
domain: isProd ? ".thehumanpatternlab.com" : undefined,

// Optional: makes sessions survive restarts for a bit
// maxAge: 1000 * 60 * 60 * 24 * 7,
// Optional: makes sessions survive restarts for a bit
// maxAge: 1000 * 60 * 60 * 24 * 7,
},
})
);
Expand Down Expand Up @@ -217,18 +217,6 @@ export function createApp() {
});
});

//TODO: THIS IS TEMP
app.get("/auth/cookie-test", (req, res) => {
(req.session as any).cookie_test = Date.now();

res.json({
ok: true,
wrote: true,
hasCookieHeader: Boolean(req.headers.cookie),
sessionID: req.sessionID,
});
});

/* ===========================================================
12) ROUTES (LAST)
-----------------------------------------------------------
Expand Down