feat: set cookie to secure and strict

This commit is contained in:
wancat committed 2024-02-09 14:24:32 +08:00
1 parent ca2a40341c
commit db16413754
3 files changed
+51 -38

No files matched your search

+3 -2
View File
@@ -9,9 +9,10 @@ export default session({
saveUninitialized: false,
rolling: true,
cookie: {
domain: config.domain,
httpOnly: true,
secure: false,
sameSite: 'lax',
secure: config.protocol === 'https:',
sameSite: 'strict',
maxAge: config.sessionMaxAge,
},
store: MongoStore.create({