added new requirements for lessons and units

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-15 16:26:09 +08:00
parent b7d62b3b18
commit 9c82b0de09
25 changed files with 1569 additions and 233 deletions
+8 -1
View File
@@ -105,7 +105,14 @@ app.use(session({
secret: process.env.SESSION_SECRET || 'change-me',
resave: false,
saveUninitialized: false,
cookie: { secure: process.env.NODE_ENV === 'production', httpOnly: true, sameSite: 'strict' },
// sameSite:'none' (not 'strict') in production — frontend (Vercel) and this
// API (Render) are cross-site, so 'strict' drops the cookie on every
// fetch/XHR call. 'none' requires secure:true, already set above.
cookie: {
secure: process.env.NODE_ENV === 'production',
httpOnly: true,
sameSite: process.env.NODE_ENV === 'production' ? 'none' : 'strict',
},
}));
// Global rate limiter (1000 req / 15 min)