移除 cookie 的 secure 属性

This commit is contained in:
2025-04-22 11:31:41 +08:00
parent 4c0fc8be6a
commit 38ca97f3ba
5 changed files with 0 additions and 18 deletions

View File

@@ -156,13 +156,11 @@ async function getUserToken(refresh = false): Promise<string> {
cookie.set('auth_token', nextAccessToken, {
httpOnly: true,
sameSite: 'strict',
secure: process.env.NODE_ENV === 'production',
maxAge: Math.max(expiresIn, 0),
})
cookie.set('auth_refresh', nextRefreshToken, {
httpOnly: true,
sameSite: 'strict',
secure: process.env.NODE_ENV === 'production',
maxAge: 7 * 24 * 3600, // 7天
})