From b61a4550c316ff385de1c4628fd753cc511680b6 Mon Sep 17 00:00:00 2001 From: sijinhui Date: Thu, 3 Oct 2024 01:48:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app/(auth)/login/loginByGoogle.tsx | 5 +++-- app/app/(auth)/login/page.tsx | 7 +++++-- app/app/login.scss | 12 ++++++++++++ lib/auth.ts | 2 +- nginx/chat.conf | 20 +++++++++++++++++++- 5 files changed, 40 insertions(+), 6 deletions(-) diff --git a/app/app/(auth)/login/loginByGoogle.tsx b/app/app/(auth)/login/loginByGoogle.tsx index 2b3b638da..46426b38b 100644 --- a/app/app/(auth)/login/loginByGoogle.tsx +++ b/app/app/(auth)/login/loginByGoogle.tsx @@ -20,7 +20,7 @@ export default function LoginByGoogle() { console.log("[auth log]", r); }); }} - className={`bg-transparent hover:bg-transparent`} + className={`bg-transparent hover:bg-transparent h-6`} > {loading ? ( @@ -35,9 +35,10 @@ export default function LoginByGoogle() { {/* */} {/**/} {/*

*/} diff --git a/app/app/(auth)/login/page.tsx b/app/app/(auth)/login/page.tsx index 41d4d81bf..59241bed0 100644 --- a/app/app/(auth)/login/page.tsx +++ b/app/app/(auth)/login/page.tsx @@ -2,6 +2,7 @@ import LoginByGithub from "./loginByGithub"; import LoginByGoogle from "./loginByGoogle"; import UserLoginCore from "./user-login-core"; import { Suspense } from "react"; +import { Space } from "antd"; export default function LoginPage() { return ( @@ -31,8 +32,10 @@ export default function LoginPage() { {" "} 其它登录方式{" "} - - + + + +

diff --git a/app/app/login.scss b/app/app/login.scss index 663cf7b2f..7b270f477 100644 --- a/app/app/login.scss +++ b/app/app/login.scss @@ -130,3 +130,15 @@ input { #login-form .ant-input-group-addon { background-color: white; } + +.cus-google-icon-color { + --tw-text-opacity: 1; + color: rgb(107 114 128/var(--tw-text-opacity)) !important; +} + +@media (prefers-color-scheme: dark) { + .cus-google-icon-color { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)) !important; + } +} \ No newline at end of file diff --git a/lib/auth.ts b/lib/auth.ts index e1fc76dc5..6eedb10e5 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -198,7 +198,7 @@ export const authOptions: NextAuthOptions = { }, // 重定向 async redirect({ url, baseUrl }) { - console.log('---------', url, new URL(url), baseUrl) + // console.log('---------', url, new URL(url), baseUrl) return baseUrl; } }, diff --git a/nginx/chat.conf b/nginx/chat.conf index 0828c6f44..e4786ea21 100644 --- a/nginx/chat.conf +++ b/nginx/chat.conf @@ -50,7 +50,25 @@ server { #PROXY-START/ -location ^~ / + # 代理到海外,匹配 /api 下名称不是 基础认证 的回调 + location ~ ^/api/auth/callback/(?!credentials).*$ { + proxy_pass http://127.0.0.1:23000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # 代理到海外,匹配 /api 下名称不是 基础认证 的登录 + location ~ ^/api/auth/signin/(?!credentials).*$ { + proxy_pass http://127.0.0.1:23000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + +location ~ / { proxy_pass http://127.0.0.1:23000; proxy_set_header Host $host;