From c2d74c8ed7920241178ea94f8c9033dc432b6fc0 Mon Sep 17 00:00:00 2001 From: Jake Howell Date: Wed, 4 Feb 2026 21:27:39 +1100 Subject: [PATCH] feat: persist `email` through `` (#21912) This pull-request implements a super simple change, essentially when we fail to login we'd like to persist the `email` used when attempting to sign-in. This just speeds up the flow rather than having to type the email in again. --- site/src/pages/LoginPage/PasswordSignInForm.tsx | 6 +++++- site/src/pages/ResetPasswordPage/RequestOTPPage.tsx | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/site/src/pages/LoginPage/PasswordSignInForm.tsx b/site/src/pages/LoginPage/PasswordSignInForm.tsx index 4ba897464d..cdf5de3e88 100644 --- a/site/src/pages/LoginPage/PasswordSignInForm.tsx +++ b/site/src/pages/LoginPage/PasswordSignInForm.tsx @@ -71,7 +71,11 @@ export const PasswordSignInForm: FC = ({ { const applicationName = getApplicationName(); const requestOTPMutation = useMutation(requestOneTimePassword()); + const [searchParams] = useSearchParams(); + const initialEmail = searchParams.get("email") ?? ""; return ( <> @@ -30,6 +32,7 @@ const RequestOTPPage: FC = () => { { requestOTPMutation.mutate({ email }); }} @@ -44,12 +47,14 @@ type RequestOTPProps = { error: unknown; onRequest: (email: string) => void; isRequesting: boolean; + initialEmail: string; }; const RequestOTP: FC = ({ error, onRequest, isRequesting, + initialEmail, }) => { return (
@@ -83,6 +88,7 @@ const RequestOTP: FC = ({ autoFocus required fullWidth + defaultValue={initialEmail} />