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