diff --git a/apps/web/pages/auth/login.tsx b/apps/web/pages/auth/login.tsx index 1e6ea5a74f..575b4ce213 100644 --- a/apps/web/pages/auth/login.tsx +++ b/apps/web/pages/auth/login.tsx @@ -51,15 +51,17 @@ export default function Login({ }: inferSSRProps & WithNonceProps) { const { t } = useLocale(); const router = useRouter(); - const formSchema = z.object({ - email: z - .string() - .min(1, `${t("error_required_field")}`) - .email(`${t("enter_valid_email")}`), - password: z.string().min(1, `${t("error_required_field")}`), - }); + const formSchema = z + .object({ + email: z + .string() + .min(1, `${t("error_required_field")}`) + .email(`${t("enter_valid_email")}`), + password: z.string().min(1, `${t("error_required_field")}`), + }) + // Passthrough other fields like totpCode + .passthrough(); const methods = useForm({ resolver: zodResolver(formSchema) }); - const { register, formState } = methods; const [twoFactorRequired, setTwoFactorRequired] = useState(!!totpEmail || false); const [errorMessage, setErrorMessage] = useState(null);