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 () => {
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);
+3 -3
View File
@@ -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 = () => {
<Routes>
<Route path={routes.login} element={<Login />} />
<Route path={routes.signup} element={<Signup />} />
<Route path={routes.resetPassword} element={<ResetPassword />} />
<Route path={routes.emailVerify} element={<EmailVerify />} />
<Route path={routes.passwordResetRequest} element={<PasswordResetRequest />} />
<Route path={routes.passwordReset} element={<PasswordReset />} />
<Route path={routes.emailVerify} element={<EmailVerify />} />
<Route element={<Layout />}>
<Route path={routes.app} element={<AllSubscriptions />} />
<Route path={routes.account} element={<Account />} />
+1 -1
View File
@@ -102,7 +102,7 @@ const Login = () => {
<Box sx={{ width: "100%" }}>
{config.enable_reset_password && (
<div style={{ float: "left" }}>
<NavLink to={routes.resetPassword} variant="body1">
<NavLink to={routes.passwordResetRequest} variant="body1">
{t("login_link_forgot_password")}
</NavLink>
</div>
@@ -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;
+3 -3
View File
@@ -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;