diff --git a/client/src/app/auth/confirm-email/[token]/page.tsx b/client/src/app/auth/confirm-email/[token]/page.tsx index 25b65113..32943fac 100644 --- a/client/src/app/auth/confirm-email/[token]/page.tsx +++ b/client/src/app/auth/confirm-email/[token]/page.tsx @@ -1,26 +1,10 @@ -import Link from "next/link"; - import ConfirmEmailForm from "@/containers/auth/confirm-email/form"; import AuthLayout from "@/containers/auth-layout"; -import { Button } from "@/components/ui/button"; -import { Card } from "@/components/ui/card"; - export default function ConfirmEmailPage() { return ( - -

- - Didn't receive your email? - - -

-
); } diff --git a/client/src/containers/auth/confirm-email/form/index.tsx b/client/src/containers/auth/confirm-email/form/index.tsx index d9c35582..84289988 100644 --- a/client/src/containers/auth/confirm-email/form/index.tsx +++ b/client/src/containers/auth/confirm-email/form/index.tsx @@ -9,7 +9,7 @@ import { useParams, useRouter, useSearchParams } from "next/navigation"; import { zodResolver } from "@hookform/resolvers/zod"; import { TOKEN_TYPE_ENUM } from "@shared/schemas/auth/token-type.schema"; import { RequestEmailUpdateSchema } from "@shared/schemas/users/request-email-update.schema"; -import { useQuery } from "@tanstack/react-query"; +import { useSuspenseQuery } from "@tanstack/react-query"; import { z } from "zod"; import { client } from "@/lib/query-client"; @@ -52,7 +52,7 @@ const NewPasswordForm: FC = () => { data: isValidToken, isFetching, isError, - } = useQuery({ + } = useSuspenseQuery({ queryKey: queryKeys.auth.confirmEmailToken(params.token).queryKey, queryFn: () => { return client.auth.validateToken.query({ @@ -105,15 +105,13 @@ const NewPasswordForm: FC = () => { Confirm your email - - {!isValidToken ? ( + {!isValidToken && ( +

The token is invalid or has expired.

- ) : ( -

To create your account please fill in the details bellow.

- )} -
+
+ )}