mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-26 14:28:46 +00:00
fix: allow creating new invite code before previous is invalid (#11649)
# Which Problems Are Solved In the refactoring of the logic for the creating and resending of invite codes (#9962), a bug was introduced where the creating of a new code was not possible if the request was to return it. It worked when being sent via mail. # How the Problems Are Solved Fixed the check for an existing code. # Additional Changes none # Additional Context - closes https://github.com/zitadel/zitadel/issues/10718 - requires backport to v4.x - relates to #9962 Co-authored-by: Marco A. <[email protected]>
This commit is contained in:
@@ -62,7 +62,7 @@ func (c *Commands) sendInviteCode(ctx context.Context, invite *CreateUserInvite,
|
||||
if !wm.CreationAllowed() {
|
||||
return nil, nil, zerrors.ThrowPreconditionFailed(nil, "COMMAND-EF34g", "Errors.User.AlreadyInitialised")
|
||||
}
|
||||
if requireExisting && wm.InviteCode == nil || wm.CodeReturned {
|
||||
if requireExisting && (wm.InviteCode == nil || wm.CodeReturned) {
|
||||
return nil, nil, zerrors.ThrowPreconditionFailed(nil, "COMMAND-Wr3gq", "Errors.User.Code.NotFound")
|
||||
}
|
||||
code, err := c.newUserInviteCode(ctx, c.eventstore.Filter, c.userEncryption) //nolint
|
||||
|
||||
Reference in New Issue
Block a user