mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-24 23:18:04 +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({
|
||||
userId: sessionFactors?.factors?.user?.id,
|
||||
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) {
|
||||
@@ -54,6 +57,9 @@ export default async function Page(props: { searchParams: Promise<any> }) {
|
||||
await resendVerification({
|
||||
userId,
|
||||
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,
|
||||
session.factors.user.organizationId,
|
||||
command.authRequestId,
|
||||
//true, // skip send as a mail was send during registration
|
||||
);
|
||||
|
||||
if (emailVerificationCheck?.redirect) {
|
||||
|
@@ -62,6 +62,7 @@ export function checkEmailVerification(
|
||||
humanUser?: HumanUser,
|
||||
organization?: string,
|
||||
authRequestId?: string,
|
||||
skipSend?: boolean,
|
||||
) {
|
||||
if (
|
||||
!humanUser?.email?.isVerified &&
|
||||
@@ -82,6 +83,10 @@ export function checkEmailVerification(
|
||||
);
|
||||
}
|
||||
|
||||
if (skipSend) {
|
||||
params.append("skipsend", "true");
|
||||
}
|
||||
|
||||
return { redirect: `/verify?` + params };
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user