Skip to content

Commit ea25339

Browse files
authored
Merge pull request #13 from AdaInTheLab/fix/oauth-failed
Configures cookie settings for OAuth.
2 parents 705fe0d + f850beb commit ea25339

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

src/app.ts

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,16 @@ export function createApp() {
176176
cookie: {
177177
httpOnly: true,
178178

179-
// ✅ must be true when sameSite is "none"
180-
secure: isProd,
179+
// ✅ must be true when sameSite is "none"
180+
secure: isProd,
181181

182-
sameSite: cookieSameSite,
182+
sameSite: "none",
183183

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

187-
// Optional: makes sessions survive restarts for a bit
188-
// maxAge: 1000 * 60 * 60 * 24 * 7,
187+
// Optional: makes sessions survive restarts for a bit
188+
// maxAge: 1000 * 60 * 60 * 24 * 7,
189189
},
190190
})
191191
);
@@ -217,18 +217,6 @@ export function createApp() {
217217
});
218218
});
219219

220-
//TODO: THIS IS TEMP
221-
app.get("/auth/cookie-test", (req, res) => {
222-
(req.session as any).cookie_test = Date.now();
223-
224-
res.json({
225-
ok: true,
226-
wrote: true,
227-
hasCookieHeader: Boolean(req.headers.cookie),
228-
sessionID: req.sessionID,
229-
});
230-
});
231-
232220
/* ===========================================================
233221
12) ROUTES (LAST)
234222
-----------------------------------------------------------

0 commit comments

Comments
 (0)