Skip to content

Commit

Permalink
fix bug login.go
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewZuo01 committed Dec 15, 2023
1 parent 9a38048 commit ca546f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/rpc/chat/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ func (o *chatSvr) SendVerifyCode(ctx context.Context, req *chat.SendVerifyCodeRe
if req.Email == "" {
_, err := o.Database.TakeAttributeByPhone(ctx, req.AreaCode, req.PhoneNumber)
if o.Database.IsNotFound(err) {
return nil, errs.ErrRecordNotFound.Wrap("phone unregistered")
return nil, eerrs.ErrAccountNotFound.Wrap("phone unregistered")
} else if err != nil {
return nil, err
}
} else {
_, err := o.Database.TakeAttributeByEmail(ctx, req.Email)
if o.Database.IsNotFound(err) {
return nil, errs.ErrRecordNotFound.Wrap("email unregistered")
return nil, eerrs.ErrAccountNotFound.Wrap("email unregistered")
} else if err != nil {
return nil, err
}
Expand Down

0 comments on commit ca546f1

Please sign in to comment.