mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-27 21:34:24 +00:00
fix: send preferred login name on init user mail (#3105)
* fix: send preferred login name on init user * trigger gh actions Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -196,12 +196,10 @@ func (u *NotifyUser) fillPreferredLoginNamesOnOrgUsers(event *es_models.Event) e
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
policy := new(query2.OrgIAMPolicy)
|
||||
if policy == nil {
|
||||
policy, err = u.getDefaultOrgIAMPolicy(context.Background())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
policy, err := u.getDefaultOrgIAMPolicy(context.Background())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !policy.UserLoginMustBeDomain {
|
||||
return nil
|
||||
@@ -225,12 +223,10 @@ func (u *NotifyUser) fillLoginNames(user *view_model.NotifyUser) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
policy := new(query2.OrgIAMPolicy)
|
||||
if policy == nil {
|
||||
policy, err = u.getDefaultOrgIAMPolicy(context.Background())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
policy, err := u.getDefaultOrgIAMPolicy(context.Background())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
user.SetLoginNames(policy, org.Domains)
|
||||
user.PreferredLoginName = user.GenerateLoginName(org.GetPrimaryDomain().Domain, policy.UserLoginMustBeDomain)
|
||||
|
||||
Reference in New Issue
Block a user