fix: userError (#4703)

Co-authored-by: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com>
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
This commit is contained in:
Paribesh Nepal
2025-02-04 15:02:57 +05:30
committed by GitHub
parent 92ae4786f0
commit db9a53f923
2 changed files with 6 additions and 3 deletions

View File

@@ -6,8 +6,9 @@ import { ZUserEmail } from "@formbricks/types/user";
export const VerificationRequestedPage = async ({ searchParams }) => {
const t = await getTranslations();
const { token } = await searchParams;
try {
const email = getEmailFromEmailToken(searchParams.token);
const email = getEmailFromEmailToken(token);
const parsedEmail = ZUserEmail.safeParse(email);
if (parsedEmail.success) {
return (

View File

@@ -4,10 +4,12 @@ import { getTranslations } from "next-intl/server";
export const VerifyPage = async ({ searchParams }) => {
const t = await getTranslations();
return searchParams && searchParams.token ? (
const { token } = await searchParams;
return token ? (
<FormWrapper>
<p className="text-center">{t("auth.verify.verifying")}</p>
<SignIn token={searchParams.token} />
<SignIn token={token} />
</FormWrapper>
) : (
<p className="text-center">{t("auth.verify.no_token_provided")}</p>