fix: resolve OAuth state cookie error - Add proper Cookie configuration with domain settings - Add domain extraction function for production environment - Update environment variables example

This commit is contained in:
theshy
2025-08-01 20:20:03 +08:00
parent da41306918
commit 2cd0ebda65
5 changed files with 162 additions and 13 deletions

View File

@ -5,6 +5,8 @@ DATABASE_URL="file:./dev.db"
# 重要:确保 URL 不包含多余的引号格式应为https://your-domain.com
NEXTAUTH_URL="https://recorder.zyj.best"
NEXTAUTH_SECRET="your-nextauth-secret"
# 可选:设置 Cookie 域名(生产环境)
NEXTAUTH_COOKIE_DOMAIN="recorder.zyj.best"
# Google OAuth
GOOGLE_CLIENT_ID="your-google-client-id"