mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
chore(console): remove first and lastName fallback from user (#5629)
* chore(console): remove first and lastName fallback from user * use display name and ensure it's set without required name fields * add user type to user grant and memberships responses * contributor, members * fix avatar display checks --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -272,7 +272,15 @@ func (h *AddHuman) ensureDisplayName() {
|
||||
if strings.TrimSpace(h.DisplayName) != "" {
|
||||
return
|
||||
}
|
||||
h.DisplayName = h.FirstName + " " + h.LastName
|
||||
if strings.TrimSpace(h.FirstName) != "" && strings.TrimSpace(h.LastName) != "" {
|
||||
h.DisplayName = h.FirstName + " " + h.LastName
|
||||
return
|
||||
}
|
||||
if strings.TrimSpace(string(h.Email.Address)) != "" {
|
||||
h.DisplayName = string(h.Email.Address)
|
||||
return
|
||||
}
|
||||
h.DisplayName = h.Username
|
||||
}
|
||||
|
||||
// shouldAddInitCode returns true for all added Humans which:
|
||||
@@ -464,7 +472,7 @@ func (c *Commands) createHuman(ctx context.Context, orgID string, human *domain.
|
||||
human.AggregateID = userID
|
||||
}
|
||||
|
||||
human.SetNamesAsDisplayname()
|
||||
human.EnsureDisplayName()
|
||||
if human.Password != nil {
|
||||
if err := human.HashPasswordIfExisting(pwPolicy, c.userPasswordAlg, human.Password.ChangeRequired); err != nil {
|
||||
return nil, nil, err
|
||||
|
Reference in New Issue
Block a user