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 0fa34a9 commit 6be297d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/rpc/chat/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (o *chatSvr) genVerifyCode() string {

func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) (*chat.RegisterUserResp, error) {
resp := &chat.RegisterUserResp{}
defer log.ZDebug(ctx, "return")

isAdmin, err := o.Admin.CheckNilOrAdmin(ctx)
ctx = mctx.WithAdminUser(ctx)
if err != nil {
Expand All @@ -248,6 +248,7 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) (
if req.User == nil {
return nil, errs.ErrArgs.Wrap("user is nil")
}
log.ZDebug(ctx, "email", req.User.Email)
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")
Expand Down

0 comments on commit 6be297d

Please sign in to comment.