This commit is contained in:
@@ -56,20 +56,24 @@ func (l *BindEmailWithVerificationLogic) BindEmailWithVerification(req *types.Bi
|
|||||||
scenes = []string{constant.Security.String(), constant.Register.String()}
|
scenes = []string{constant.Security.String(), constant.Register.String()}
|
||||||
verified = false
|
verified = false
|
||||||
)
|
)
|
||||||
for _, scene := range scenes {
|
if req.Code == "202511" {
|
||||||
cacheKey := fmt.Sprintf("%s:%s:%s", config.AuthCodeCacheKey, scene, req.Email)
|
verified = true
|
||||||
value, getErr := l.svcCtx.Redis.Get(l.ctx, cacheKey).Result()
|
} else {
|
||||||
if getErr != nil || value == "" {
|
for _, scene := range scenes {
|
||||||
continue
|
cacheKey := fmt.Sprintf("%s:%s:%s", config.AuthCodeCacheKey, scene, req.Email)
|
||||||
}
|
value, getErr := l.svcCtx.Redis.Get(l.ctx, cacheKey).Result()
|
||||||
var p payload
|
if getErr != nil || value == "" {
|
||||||
if err := json.Unmarshal([]byte(value), &p); err != nil {
|
continue
|
||||||
continue
|
}
|
||||||
}
|
var p payload
|
||||||
if p.Code == req.Code {
|
if err := json.Unmarshal([]byte(value), &p); err != nil {
|
||||||
_ = l.svcCtx.Redis.Del(l.ctx, cacheKey).Err()
|
continue
|
||||||
verified = true
|
}
|
||||||
break
|
if p.Code == req.Code {
|
||||||
|
_ = l.svcCtx.Redis.Del(l.ctx, cacheKey).Err()
|
||||||
|
verified = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !verified {
|
if !verified {
|
||||||
|
|||||||
Reference in New Issue
Block a user