mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-25 19:27:06 +00:00
fix error handler, skip send
This commit is contained in:
@@ -47,6 +47,9 @@ export default async function Page(props: { searchParams: Promise<any> }) {
|
|||||||
await resendVerification({
|
await resendVerification({
|
||||||
userId: sessionFactors?.factors?.user?.id,
|
userId: sessionFactors?.factors?.user?.id,
|
||||||
isInvite: invite === "true",
|
isInvite: invite === "true",
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error("Could not resend verification email", error);
|
||||||
|
throw Error("Could not request email");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if ("userId" in searchParams && userId) {
|
} else if ("userId" in searchParams && userId) {
|
||||||
@@ -54,6 +57,9 @@ export default async function Page(props: { searchParams: Promise<any> }) {
|
|||||||
await resendVerification({
|
await resendVerification({
|
||||||
userId,
|
userId,
|
||||||
isInvite: invite === "true",
|
isInvite: invite === "true",
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error("Could not resend verification email", error);
|
||||||
|
throw Error("Could not request email");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -92,6 +92,7 @@ export async function registerUser(command: RegisterUserCommand) {
|
|||||||
humanUser,
|
humanUser,
|
||||||
session.factors.user.organizationId,
|
session.factors.user.organizationId,
|
||||||
command.authRequestId,
|
command.authRequestId,
|
||||||
|
//true, // skip send as a mail was send during registration
|
||||||
);
|
);
|
||||||
|
|
||||||
if (emailVerificationCheck?.redirect) {
|
if (emailVerificationCheck?.redirect) {
|
||||||
|
@@ -62,6 +62,7 @@ export function checkEmailVerification(
|
|||||||
humanUser?: HumanUser,
|
humanUser?: HumanUser,
|
||||||
organization?: string,
|
organization?: string,
|
||||||
authRequestId?: string,
|
authRequestId?: string,
|
||||||
|
skipSend?: boolean,
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
!humanUser?.email?.isVerified &&
|
!humanUser?.email?.isVerified &&
|
||||||
@@ -82,6 +83,10 @@ export function checkEmailVerification(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (skipSend) {
|
||||||
|
params.append("skipsend", "true");
|
||||||
|
}
|
||||||
|
|
||||||
return { redirect: `/verify?` + params };
|
return { redirect: `/verify?` + params };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user