update: dev env

This commit is contained in:
Nathan FONTEYNE 2026-07-08 11:28:23 +02:00
parent c3380179ce
commit 73ebd6ad49

View file

@ -16,7 +16,11 @@ module.exports = session({
cookie: { cookie: {
httpOnly: true, httpOnly: true,
sameSite: 'lax', sameSite: 'lax',
secure: config.nodeEnv === 'production', // Never mark the cookie Secure in dev-bypass mode: it's meant to be tested
// over plain http://localhost, and browsers silently drop Secure cookies
// on non-HTTPS origins, which would otherwise cause an endless redirect
// back to /auth/login after a seemingly successful dev login.
secure: config.nodeEnv === 'production' && !config.devBypassAuth,
maxAge: 1000 * 60 * 60 * 24 * 30, maxAge: 1000 * 60 * 60 * 24 * 30,
}, },
}); });