From ea339bf62145214c1dbb8d17e4bac8b17d1cd3ad Mon Sep 17 00:00:00 2001 From: chenhang Date: Fri, 12 Jun 2026 16:43:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=88=A0=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/auth/nextauth.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/lib/auth/nextauth.ts b/src/lib/auth/nextauth.ts index d2dcfcce..d6c62f68 100644 --- a/src/lib/auth/nextauth.ts +++ b/src/lib/auth/nextauth.ts @@ -30,9 +30,6 @@ const handler = NextAuth({ clientSecret: process.env.AUTH_FACEBOOK_SECRET ?? "", }), ], - pages: { - signIn: "/auth", - }, // 把 OAuth provider 的 token 塞进 NextAuth session,供前端取用: // - Google: account.id_token → 调后端 /api/auth/google-login 换业务 token // - Facebook: account.access_token → 调后端 /api/auth/facebook-login @@ -55,11 +52,6 @@ const handler = NextAuth({ return session; }, }, - // 显式允许从请求头(X-Forwarded-Host)推断 host;消除 v4 [NEXTAUTH_URL] 警告 - // 生产部署在反向代理后(nginx / cloudflare)必须开 - // @ts-expect-error: `trustHost` 不在 v4.24.x 的 AuthOptions 类型里,但运行时支持 - trustHost: true, - secret: process.env.AUTH_SECRET ?? "dev-secret-change-in-prod", }); export { handler as GET, handler as POST };