File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,16 @@ func (r *roleSyncer) CreateAccount(
363363 Name : "password" ,
364364 Bytes : []byte (plainTextPassword ),
365365 }
366- roleModel , err = r .client .CreateUser (ctx , accountInfo .GetLogin (), plainTextPassword )
366+ // Default to C1 User's login as email
367+ email := accountInfo .GetLogin ()
368+ // If the account provisioning schema has been filled, use the calculated email field
369+ if accountInfo .Profile != nil {
370+ profileMap := accountInfo .Profile .GetFields ()
371+ if value , ok := profileMap ["email" ]; ok && value .GetStringValue () != "" {
372+ email = value .GetStringValue ()
373+ }
374+ }
375+ roleModel , err = r .client .CreateUser (ctx , email , plainTextPassword )
367376 if err != nil {
368377 return nil , nil , nil , err
369378 }
You can’t perform that action at this time.
0 commit comments