mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 15:03:52 +00:00
error handling
This commit is contained in:
@@ -16,11 +16,17 @@ type VerifyUserByEmailCommand = {
|
|||||||
|
|
||||||
export async function verifyUser(command: VerifyUserByEmailCommand) {
|
export async function verifyUser(command: VerifyUserByEmailCommand) {
|
||||||
const verifyResponse = command.isInvite
|
const verifyResponse = command.isInvite
|
||||||
? await verifyInviteCode(command.userId, command.code)
|
? await verifyInviteCode(command.userId, command.code).catch((error) => {
|
||||||
: await verifyEmail(command.userId, command.code);
|
console.log(error.code);
|
||||||
|
return { error: "Could not verify invite" };
|
||||||
|
})
|
||||||
|
: await verifyEmail(command.userId, command.code).catch((error) => {
|
||||||
|
console.log(error.code);
|
||||||
|
return { error: "Could not verify email" };
|
||||||
|
});
|
||||||
|
|
||||||
if (!verifyResponse) {
|
if (!verifyResponse) {
|
||||||
return { error: "Could not verify user email" };
|
return { error: "Could not verify user" };
|
||||||
}
|
}
|
||||||
|
|
||||||
const authMethodResponse = await listAuthenticationMethodTypes(
|
const authMethodResponse = await listAuthenticationMethodTypes(
|
||||||
|
|||||||
Reference in New Issue
Block a user