mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-24 17:16:38 +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.
This commit is contained in:
@@ -267,7 +267,7 @@ export async function sendLoginname(command: SendLoginnameCommand) {
|
||||
const params = new URLSearchParams({
|
||||
loginName: session.factors?.user?.loginName as string,
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user