Skip to content

Commit

Permalink
FIX BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewZuo01 committed Nov 29, 2023
1 parent fcde966 commit 0fa34a9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/rpc/chat/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,10 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) (
if req.User == nil {
return nil, errs.ErrArgs.Wrap("user is nil")
}
if (req.User.AreaCode == "" && req.User.PhoneNumber != "") || (req.User.AreaCode != "" && req.User.PhoneNumber == "") {
return nil, errs.ErrArgs.Wrap("area code or phone number error")
}
if (req.User.PhoneNumber == "" || req.User.Account == "") && req.User.Email == "" {
return nil, errs.ErrArgs.Wrap("phone number, account, and email is empty")
if req.User.Email == "" {
if (req.User.AreaCode == "" && req.User.PhoneNumber != "") || (req.User.AreaCode != "" && req.User.PhoneNumber == "") {
return nil, errs.ErrArgs.Wrap("area code or phone number error, no email provide")
}
}
var usedInvitationCode bool
if !isAdmin {
Expand Down

0 comments on commit 0fa34a9

Please sign in to comment.