Skip to content

Commit 701d5b6

Browse files
committed
fix: Persist email when moving between forgot too
https://harperdb.atlassian.net/browse/STUDIO-512
1 parent 7c2274b commit 701d5b6

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/features/auth/ForgotPassword.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function ForgotPassword() {
4747
onClick: () => toast.dismiss(),
4848
},
4949
});
50-
navigate({ to: '/sign-in' });
50+
navigate({ to: '/sign-in', search: { me: email } });
5151
},
5252
});
5353
};

src/features/auth/ResetPassword.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const ResetPasswordSchema = z
2727
path: ['confirmPassword'],
2828
});
2929

30-
export function RestPassword() {
30+
export function ResetPassword() {
3131
const { token } = useSearch({ strict: false });
3232
const navigate = useNavigate();
3333

src/features/auth/VerifyEmail.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function SendEmailVerification() {
2929
email: '',
3030
},
3131
});
32+
const email = methods.watch('email');
3233
const { setFocus, control, handleSubmit } = methods;
3334

3435
useEffect(() => {
@@ -45,7 +46,7 @@ function SendEmailVerification() {
4546
onClick: () => toast.dismiss(),
4647
},
4748
});
48-
navigate({ to: '/sign-in' });
49+
navigate({ to: '/sign-in', search: { me: email } });
4950
},
5051
});
5152
}, [navigate, submitResendEmailVerification]);

src/features/auth/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defaultInstanceRoute } from '@/config/constants';
22
import { AuthLayout } from '@/features/auth/AuthLayout';
33
import { ClusterInstanceSignIn } from '@/features/auth/ClusterInstanceSignIn';
44
import { ForgotPassword } from '@/features/auth/ForgotPassword';
5-
import { RestPassword as ResetPassword } from '@/features/auth/ResetPassword';
5+
import { ResetPassword } from '@/features/auth/ResetPassword';
66
import { SignIn } from '@/features/auth/SignIn';
77
import { SignUp } from '@/features/auth/SignUp';
88
import { VerifyEmail } from '@/features/auth/VerifyEmail';

0 commit comments

Comments
 (0)