Skip to content

Commit

Permalink
fix: 修改重置密码的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansongxx committed Mar 19, 2024
1 parent 2ee4f91 commit 548d569
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion biz/application/service/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s *AuthServiceImpl) SetPassword(ctx context.Context, req *gensts.SetPasswo
switch o := req.Key.(type) {
case *gensts.SetPasswordReq_EmailOptions:
value := ""
if value, err = s.Redis.GetCtx(ctx, fmt.Sprintf("%s:%s", consts.PassCheckEmail, req.Password)); err != nil {
if value, err = s.Redis.GetCtx(ctx, fmt.Sprintf("%s:%s", consts.PassCheckEmail, o.EmailOptions.Email)); err != nil {
return resp, err
}
if value != "true" {
Expand All @@ -97,6 +97,11 @@ func (s *AuthServiceImpl) SetPassword(ctx context.Context, req *gensts.SetPasswo
if err != nil {
return resp, err
}

if _, err = s.Redis.DelCtx(ctx, fmt.Sprintf("%s:%s", consts.PassCheckEmail, o.EmailOptions.Email)); err != nil {
return resp, err
}

case *gensts.SetPasswordReq_UserIdOptions:
user, err = s.UserMongoMapper.FindOne(ctx, o.UserIdOptions.UserId)
if err != nil {
Expand Down

0 comments on commit 548d569

Please sign in to comment.