mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-02 14:12:27 +00:00
fix(login): send invite codes only for users with unverified email (#10943)
# Which Problems Are Solved
When a user with no authentication methods attempted to log in, the
system always set `invite=true` in the verification flow, regardless of
whether their email was already verified. This could cause errors when
trying to send invite codes to already initialized users.
# How the Problems Are Solved
Added conditional logic to determine whether to send an invite code
based on the user's email verification status:
This prevents errors when attempting to send invite codes to users who
have already verified their email and been initialized, while still
properly handling new users who need invitation flows.
(cherry picked from commit d10be4c09a)
This commit is contained in:
committed by
Livio Spring
parent
aa8c02b189
commit
d4fec7ebaf
@@ -267,7 +267,7 @@ export async function sendLoginname(command: SendLoginnameCommand) {
|
|||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
loginName: session.factors?.user?.loginName as string,
|
loginName: session.factors?.user?.loginName as string,
|
||||||
send: "true", // set this to true to request a new code immediately
|
send: "true", // set this to true to request a new code immediately
|
||||||
invite: "true", // humanUser?.email?.isVerified ? "false" : "true", // sendInviteEmailCode results in an error if user is already initialized
|
invite: humanUser?.email?.isVerified ? "false" : "true", // sendInviteEmailCode results in an error if user is already initialized
|
||||||
});
|
});
|
||||||
|
|
||||||
if (command.requestId) {
|
if (command.requestId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user