From 36d7d3bd241ccc973a1fbc9dd5761be5c3181cb1 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Sat, 20 Jun 2026 14:55:27 -0400 Subject: [PATCH] Rename --- web/src/components/Account.jsx | 1 + web/src/components/App.jsx | 6 +++--- web/src/components/Login.jsx | 2 +- .../{ResetPassword.jsx => PasswordResetRequest.jsx} | 8 ++++---- web/src/components/routes.js | 6 +++--- 5 files changed, 12 insertions(+), 11 deletions(-) rename web/src/components/{ResetPassword.jsx => PasswordResetRequest.jsx} (93%) diff --git a/web/src/components/Account.jsx b/web/src/components/Account.jsx index 016d97e4..f37089e0 100644 --- a/web/src/components/Account.jsx +++ b/web/src/components/Account.jsx @@ -567,6 +567,7 @@ const AddEmailDialog = (props) => { const handleSubmit = async () => { try { setSending(true); + setError(""); // Clear any error from a previous attempt await accountApi.startEmailVerification(email); await accountApi.sync(); // Refresh so the new "(unverified)" address shows up immediately setSent(true); diff --git a/web/src/components/App.jsx b/web/src/components/App.jsx index bfa38d42..d386fedd 100644 --- a/web/src/components/App.jsx +++ b/web/src/components/App.jsx @@ -22,7 +22,7 @@ import Signup from "./Signup"; import Account from "./Account"; import EmailVerify from "./EmailVerify"; import PasswordReset from "./PasswordReset"; -import ResetPassword from "./ResetPassword"; +import PasswordResetRequest from "./PasswordResetRequest"; import initI18n from "../app/i18n"; // Translations! import prefs from "../app/Prefs"; import RTLCacheProvider from "./RTLCacheProvider"; @@ -66,9 +66,9 @@ const App = () => { } /> } /> - } /> - } /> + } /> } /> + } /> }> } /> } /> diff --git a/web/src/components/Login.jsx b/web/src/components/Login.jsx index 9bf8e1c5..ad14ebb9 100644 --- a/web/src/components/Login.jsx +++ b/web/src/components/Login.jsx @@ -102,7 +102,7 @@ const Login = () => { {config.enable_reset_password && (
- + {t("login_link_forgot_password")}
diff --git a/web/src/components/ResetPassword.jsx b/web/src/components/PasswordResetRequest.jsx similarity index 93% rename from web/src/components/ResetPassword.jsx rename to web/src/components/PasswordResetRequest.jsx index 6b765d5f..3a93ba14 100644 --- a/web/src/components/ResetPassword.jsx +++ b/web/src/components/PasswordResetRequest.jsx @@ -8,11 +8,11 @@ import accountApi from "../app/AccountApi"; import AvatarBox from "./AvatarBox"; import routes from "./routes"; -// ResetPassword is the standalone "request a password reset" page, reached from the login page. +// PasswordResetRequest is the standalone "request a password reset" page, reached from the login page. // It collects a username/email and asks the server to email a reset link. The response is uniform, // so the page always shows the same confirmation. Completing the reset happens on the separate // PasswordReset landing page that the emailed link points to. -const ResetPassword = () => { +const PasswordResetRequest = () => { const { t } = useTranslation(); const [identifier, setIdentifier] = useState(""); const [sending, setSending] = useState(false); @@ -24,7 +24,7 @@ const ResetPassword = () => { setSending(true); await accountApi.requestPasswordReset(identifier); } catch (e) { - console.log(`[ResetPassword] Request failed`, e); + console.log(`[PasswordResetRequest] Request failed`, e); } finally { setSending(false); setSent(true); // Uniform outcome regardless of success/failure (enumeration-safe) @@ -92,4 +92,4 @@ const ResetPassword = () => { ); }; -export default ResetPassword; +export default PasswordResetRequest; diff --git a/web/src/components/routes.js b/web/src/components/routes.js index 463fb237..e81d077b 100644 --- a/web/src/components/routes.js +++ b/web/src/components/routes.js @@ -4,12 +4,12 @@ import { shortUrl } from "../app/utils"; const routes = { login: "/login", signup: "/signup", - resetPassword: "/reset-password", app: config.app_root, account: "/account", settings: "/settings", - emailVerify: "/account/email/verify/:token", + passwordResetRequest: "/reset-password", passwordReset: "/account/password/reset/:token", + emailVerify: "/account/email/verify/:token", subscription: "/:topic", subscriptionExternal: "/:baseUrl/:topic", forSubscription: (subscription) => { @@ -17,7 +17,7 @@ const routes = { return `/${shortUrl(subscription.baseUrl)}/${subscription.topic}`; } return `/${subscription.topic}`; - }, + } }; export default routes;