From 01c84f9a450bce29e126347136ca75529caa9fdd Mon Sep 17 00:00:00 2001 From: "Apple\\Apple" Date: Thu, 5 Jun 2025 11:19:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20refactor:=20move=20Turnstile=20c?= =?UTF-8?q?omponent=20to=20global=20scope=20in=20auth=20forms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the Turnstile verification component from the renderOAuthOptions method to the main render function in both LoginForm and RegisterForm components. This ensures the Turnstile verification is globally visible and accessible regardless of which authentication method the user chooses (email login/register or third-party OAuth options). The change improves UI consistency and ensures the verification mechanism works properly across all authentication flows. --- web/src/components/auth/LoginForm.js | 22 +++++++++++----------- web/src/components/auth/RegisterForm.js | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/web/src/components/auth/LoginForm.js b/web/src/components/auth/LoginForm.js index b9c62eef..fb5104e1 100644 --- a/web/src/components/auth/LoginForm.js +++ b/web/src/components/auth/LoginForm.js @@ -362,17 +362,6 @@ const LoginForm = () => { - - {turnstileEnabled && ( -
- { - setTurnstileToken(token); - }} - /> -
- )} ); @@ -528,6 +517,17 @@ const LoginForm = () => { ? renderEmailLoginForm() : renderOAuthOptions()} {renderWeChatLoginModal()} + + {turnstileEnabled && ( +
+ { + setTurnstileToken(token); + }} + /> +
+ )} ); diff --git a/web/src/components/auth/RegisterForm.js b/web/src/components/auth/RegisterForm.js index 217d4bcb..322b4990 100644 --- a/web/src/components/auth/RegisterForm.js +++ b/web/src/components/auth/RegisterForm.js @@ -368,17 +368,6 @@ const RegisterForm = () => { - - {turnstileEnabled && ( -
- { - setTurnstileToken(token); - }} - /> -
- )} ); @@ -568,6 +557,17 @@ const RegisterForm = () => { ? renderEmailRegisterForm() : renderOAuthOptions()} {renderWeChatLoginModal()} + + {turnstileEnabled && ( +
+ { + setTurnstileToken(token); + }} + /> +
+ )} );