diff --git a/apps/consent/app/login/email-login-form.tsx b/apps/consent/app/login/email-login-form.tsx index 3b822df352c..65df80b6313 100644 --- a/apps/consent/app/login/email-login-form.tsx +++ b/apps/consent/app/login/email-login-form.tsx @@ -2,6 +2,7 @@ import React from "react" import { useFormState } from "react-dom" +import { useRouter } from "next/navigation" import { toast } from "react-toastify" import InputComponent from "../../components/input-component" @@ -23,6 +24,8 @@ interface LoginProps { } const EmailLoginForm = ({ login_challenge }: LoginProps) => { + const router = useRouter() + const [state, formAction] = useFormState(submitForm, { error: false, message: null, @@ -73,11 +76,12 @@ const EmailLoginForm = ({ login_challenge }: LoginProps) => { Next router.back()} > Cancel diff --git a/apps/consent/components/phone-auth/phone-auth-form.tsx b/apps/consent/components/phone-auth/phone-auth-form.tsx index 835f80a2456..f973f2b4bc0 100644 --- a/apps/consent/components/phone-auth/phone-auth-form.tsx +++ b/apps/consent/components/phone-auth/phone-auth-form.tsx @@ -34,6 +34,7 @@ import SelectComponent from "@/components/select" import RegisterLink from "@/components/register-link" import { GetCaptchaChallengeResponse } from "@/app/types/phone-auth.types" +import { useRouter } from "next/navigation" interface AuthFormProps { authAction: "Register" | "Login" @@ -46,6 +47,7 @@ const PhoneAuthForm: React.FC = ({ countryCodes, authAction, }) => { + const router = useRouter() const [phoneNumber, setPhoneNumber] = useState("") const [state, formAction] = useFormState( getCaptchaChallenge, @@ -156,11 +158,12 @@ const PhoneAuthForm: React.FC = ({ Next router.back()} > Cancel