mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-12 15:23:41 +00:00
fix: nil pointer on add user (missing phone) (#3487)
This commit is contained in:
parent
81c010adaa
commit
0b6eb07e2d
@ -199,7 +199,7 @@ func (s *Server) AddHumanUser(ctx context.Context, req *mgmt_pb.AddHumanUserRequ
|
||||
lang, err := language.Parse(req.Profile.PreferredLanguage)
|
||||
logging.OnError(err).Debug("unable to parse language")
|
||||
|
||||
details, err := s.command.AddHuman(ctx, authz.GetCtxData(ctx).OrgID, &command.AddHuman{
|
||||
human := &command.AddHuman{
|
||||
Username: req.UserName,
|
||||
FirstName: req.Profile.FirstName,
|
||||
LastName: req.Profile.LastName,
|
||||
@ -220,7 +220,14 @@ func (s *Server) AddHumanUser(ctx context.Context, req *mgmt_pb.AddHumanUserRequ
|
||||
Passwordless: false,
|
||||
Register: false,
|
||||
ExternalIDP: false,
|
||||
})
|
||||
}
|
||||
if req.Phone != nil {
|
||||
human.Phone = command.Phone{
|
||||
Number: req.Phone.Phone,
|
||||
Verified: req.Phone.IsPhoneVerified,
|
||||
}
|
||||
}
|
||||
details, err := s.command.AddHuman(ctx, authz.GetCtxData(ctx).OrgID, human)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user