Skip to content

Commit

Permalink
fix; login
Browse files Browse the repository at this point in the history
  • Loading branch information
withchao committed Mar 13, 2024
1 parent 264a24f commit cdea715
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/rpc/chat/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) (
}

func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginResp, error) {
defer log.ZInfo(ctx, "Login")
resp := &chat.LoginResp{}
if req.Password == "" && req.VerifyCode == "" {
return nil, errs.ErrArgs.Wrap("password or code must be set")
Expand Down Expand Up @@ -455,8 +454,9 @@ func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginRes
if err != nil {
return nil, err
}
log.ZInfo(ctx, "Login verifyCode", "id", id)
verifyCodeID = &id
if id != "" {
verifyCodeID = &id
}
} else {
account, err := o.Database.GetAccount(ctx, attribute.UserID)
if err != nil {
Expand Down

0 comments on commit cdea715

Please sign in to comment.