فهرست منبع

🐛 fix(auth): prevent duplicate “session expired” toast on login

Login Form used to display the message “未登录或登录已过期,请重新登录” twice
because the `useEffect` that inspects the `expired` query parameter was
re-executed on every re-render (e.g. language change or React StrictMode’s
double-mount in development).

### What's changed
• **LoginForm.js** – `useEffect` that shows the toast now has an empty
  dependency array so it runs only once on initial mount.
• Reviewed **PasswordResetConfirm.js**, **PasswordResetForm.js** and
  **RegisterForm.js** and confirmed they do not contain the same issue;
  no changes were required.

### Impact
Users now see the “session expired” notification exactly once, removing
confusion and improving the overall UX.
t0ng7u 10 ماه پیش
والد
کامیت
86f374df58
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      web/src/components/auth/LoginForm.js

+ 1 - 1
web/src/components/auth/LoginForm.js

@@ -84,7 +84,7 @@ const LoginForm = () => {
     if (searchParams.get('expired')) {
       showError(t('未登录或登录已过期,请重新登录'));
     }
-  }, [searchParams, t]);
+  }, []);
 
   const onWeChatLoginClicked = () => {
     setWechatLoading(true);