From fe47bd2c18f2093ccd1ce41880004237dcee5d3e Mon Sep 17 00:00:00 2001 From: Zixin Zhou Date: Sat, 20 Sep 2025 21:40:24 +0800 Subject: [PATCH] updates google login --- next.config.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/next.config.js b/next.config.js index a249a2d..00bde2b 100644 --- a/next.config.js +++ b/next.config.js @@ -50,15 +50,15 @@ const nextConfig = { const AUTH_API_URL = process.env.NEXT_PUBLIC_JAVA_URL // const BASE_URL = 'http://192.168.120.5:8000' return [ - // Google OAuth2 回调代理 + // Google OAuth2 API代理 (排除callback,让Next.js本地处理) { - source: '/api/auth/google/:path*', - destination: `${AUTH_API_URL}/api/auth/google/:path*`, + source: '/api/auth/google/((?!callback).*)', + destination: `${AUTH_API_URL}/api/auth/google/$1`, }, - // 其他认证相关API代理 + // 其他认证相关API代理 (排除google路径) { - source: '/api/auth/:path*', - destination: `${AUTH_API_URL}/api/auth/:path*`, + source: '/api/auth/((?!google).)*', + destination: `${AUTH_API_URL}/api/auth/$1`, }, { source: '/api/user/:path*',