Ramsai
Ramsai9mo ago

Email Verification while user registration

Hi team, I am working on sending a verification email to newly registered users. I am getting the 400 error whenever I try to register a user , the error message is "proto: (line 1:115): error parsing "sendCode", oneof zitadel.user.v2.SetHumanEmail.verification is already set". this is my API request const response = await fetch( ${process.env.NEXT_PUBLIC_ZITADEL_AUTHORITY}/v2/users/human, { method: "POST", headers: { Accept: "application/json", "Content-Type": "application/json", Authorization: Bearer ${process.env.NEXT_PUBLIC_ZITADEL_PAT}, }, body: JSON.stringify({ ...registrationData, email: { ...registrationData.email, isVerified: false, sendCode: { urlTemplate: ${process.env.NEXT_PUBLIC_URL}/auth/login/verify?userID={{.UserID}}&code={{.Code}}&orgID={{.OrgID}}, }, }, }), } ); Please help me send a verification request and make sure this flow is working fine
2 Replies
fabienne
fabienne9mo ago
can you try to leave the isVerified empty?
Ramsai
RamsaiOP9mo ago
Thanks!! It is working

Did you find this page helpful?