Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix change button not doing anything (#960)

Luke Vellafc6c1d54cdd6
diff --git a/apps/web/src/app/[locale]/(auth)/login/login-form.tsx b/apps/web/src/app/[locale]/(auth)/login/login-form.tsx
index 2eb528d51..01cc39d33 100644
--- a/apps/web/src/app/[locale]/(auth)/login/login-form.tsx
+++ b/apps/web/src/app/[locale]/(auth)/login/login-form.tsx
@@ -69,6 +69,9 @@ export function LoginForm({ oidcConfig }: { oidcConfig?: { name: string } }) {
}
}}
email={getValues("email")}
+ onChangeEmail={() => {
+ setEmail(undefined);
+ }}
/>
);
}
diff --git a/apps/web/src/app/[locale]/(auth)/register/register-page.tsx b/apps/web/src/app/[locale]/(auth)/register/register-page.tsx
index 2ea6979b0..1d5226406 100644
--- a/apps/web/src/app/[locale]/(auth)/register/register-page.tsx
+++ b/apps/web/src/app/[locale]/(auth)/register/register-page.tsx
@@ -68,6 +68,9 @@ export const RegisterForm = () => {
});
}}
email={getValues("email")}
+ onChangeEmail={() => {
+ setToken(undefined);
+ }}
/>
);
}
diff --git a/apps/web/src/components/auth/auth-forms.tsx b/apps/web/src/components/auth/auth-forms.tsx
index dc8fce2f9..05f7bdb7c 100644
--- a/apps/web/src/components/auth/auth-forms.tsx
+++ b/apps/web/src/components/auth/auth-forms.tsx
@@ -22,7 +22,8 @@ export const verifyCode = async (options: { email: string; token: string }) => {
export const VerifyCode: React.FunctionComponent<{
email: string;
onSubmit: (code: string) => Promise<void>;
-}> = ({ onSubmit, email }) => {
+ onChangeEmail?: () => void;
+}> = ({ onSubmit, onChangeEmail, email }) => {
const { register, handleSubmit, setError, formState } = useForm<{
code: string;
}>();
@@ -58,11 +59,11 @@ export const VerifyCode: React.FunctionComponent<{
components={{
b: <strong className="whitespace-nowrap" />,
a: (
- <a
+ <button
+ role="button"
className="text-link"
- href="#"
- onClick={(e) => {
- e.preventDefault();
+ onClick={() => {
+ onChangeEmail?.();
}}
/>
),