This commit is contained in:
binwiederhier
2026-06-20 14:55:27 -04:00
parent 8a7b73cc7e
commit 36d7d3bd24
5 changed files with 12 additions and 11 deletions
+1
View File
@@ -567,6 +567,7 @@ const AddEmailDialog = (props) => {
const handleSubmit = async () => { const handleSubmit = async () => {
try { try {
setSending(true); setSending(true);
setError(""); // Clear any error from a previous attempt
await accountApi.startEmailVerification(email); await accountApi.startEmailVerification(email);
await accountApi.sync(); // Refresh so the new "(unverified)" address shows up immediately await accountApi.sync(); // Refresh so the new "(unverified)" address shows up immediately
setSent(true); setSent(true);
+3 -3
View File
@@ -22,7 +22,7 @@ import Signup from "./Signup";
import Account from "./Account"; import Account from "./Account";
import EmailVerify from "./EmailVerify"; import EmailVerify from "./EmailVerify";
import PasswordReset from "./PasswordReset"; import PasswordReset from "./PasswordReset";
import ResetPassword from "./ResetPassword"; import PasswordResetRequest from "./PasswordResetRequest";
import initI18n from "../app/i18n"; // Translations! import initI18n from "../app/i18n"; // Translations!
import prefs from "../app/Prefs"; import prefs from "../app/Prefs";
import RTLCacheProvider from "./RTLCacheProvider"; import RTLCacheProvider from "./RTLCacheProvider";
@@ -66,9 +66,9 @@ const App = () => {
<Routes> <Routes>
<Route path={routes.login} element={<Login />} /> <Route path={routes.login} element={<Login />} />
<Route path={routes.signup} element={<Signup />} /> <Route path={routes.signup} element={<Signup />} />
<Route path={routes.resetPassword} element={<ResetPassword />} /> <Route path={routes.passwordResetRequest} element={<PasswordResetRequest />} />
<Route path={routes.emailVerify} element={<EmailVerify />} />
<Route path={routes.passwordReset} element={<PasswordReset />} /> <Route path={routes.passwordReset} element={<PasswordReset />} />
<Route path={routes.emailVerify} element={<EmailVerify />} />
<Route element={<Layout />}> <Route element={<Layout />}>
<Route path={routes.app} element={<AllSubscriptions />} /> <Route path={routes.app} element={<AllSubscriptions />} />
<Route path={routes.account} element={<Account />} /> <Route path={routes.account} element={<Account />} />
+1 -1
View File
@@ -102,7 +102,7 @@ const Login = () => {
<Box sx={{ width: "100%" }}> <Box sx={{ width: "100%" }}>
{config.enable_reset_password && ( {config.enable_reset_password && (
<div style={{ float: "left" }}> <div style={{ float: "left" }}>
<NavLink to={routes.resetPassword} variant="body1"> <NavLink to={routes.passwordResetRequest} variant="body1">
{t("login_link_forgot_password")} {t("login_link_forgot_password")}
</NavLink> </NavLink>
</div> </div>
@@ -8,11 +8,11 @@ import accountApi from "../app/AccountApi";
import AvatarBox from "./AvatarBox"; import AvatarBox from "./AvatarBox";
import routes from "./routes"; 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, // 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 // so the page always shows the same confirmation. Completing the reset happens on the separate
// PasswordReset landing page that the emailed link points to. // PasswordReset landing page that the emailed link points to.
const ResetPassword = () => { const PasswordResetRequest = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const [identifier, setIdentifier] = useState(""); const [identifier, setIdentifier] = useState("");
const [sending, setSending] = useState(false); const [sending, setSending] = useState(false);
@@ -24,7 +24,7 @@ const ResetPassword = () => {
setSending(true); setSending(true);
await accountApi.requestPasswordReset(identifier); await accountApi.requestPasswordReset(identifier);
} catch (e) { } catch (e) {
console.log(`[ResetPassword] Request failed`, e); console.log(`[PasswordResetRequest] Request failed`, e);
} finally { } finally {
setSending(false); setSending(false);
setSent(true); // Uniform outcome regardless of success/failure (enumeration-safe) setSent(true); // Uniform outcome regardless of success/failure (enumeration-safe)
@@ -92,4 +92,4 @@ const ResetPassword = () => {
); );
}; };
export default ResetPassword; export default PasswordResetRequest;
+3 -3
View File
@@ -4,12 +4,12 @@ import { shortUrl } from "../app/utils";
const routes = { const routes = {
login: "/login", login: "/login",
signup: "/signup", signup: "/signup",
resetPassword: "/reset-password",
app: config.app_root, app: config.app_root,
account: "/account", account: "/account",
settings: "/settings", settings: "/settings",
emailVerify: "/account/email/verify/:token", passwordResetRequest: "/reset-password",
passwordReset: "/account/password/reset/:token", passwordReset: "/account/password/reset/:token",
emailVerify: "/account/email/verify/:token",
subscription: "/:topic", subscription: "/:topic",
subscriptionExternal: "/:baseUrl/:topic", subscriptionExternal: "/:baseUrl/:topic",
forSubscription: (subscription) => { forSubscription: (subscription) => {
@@ -17,7 +17,7 @@ const routes = {
return `/${shortUrl(subscription.baseUrl)}/${subscription.topic}`; return `/${shortUrl(subscription.baseUrl)}/${subscription.topic}`;
} }
return `/${subscription.topic}`; return `/${subscription.topic}`;
}, }
}; };
export default routes; export default routes;