Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

update captcha

aichy12cc225d5b8d
diff --git a/internal/controller/user_controller.go b/internal/controller/user_controller.go
index 4571de16..c9b7aaea 100644
--- a/internal/controller/user_controller.go
+++ b/internal/controller/user_controller.go
@@ -108,7 +108,7 @@ func (uc *UserController) UserEmailLogin(ctx *gin.Context) {
}
isAdmin := middleware.GetUserIsAdminModerator(ctx)
if !isAdmin {
- captchaPass := uc.actionService.ActionRecordVerifyCaptcha(ctx, entity.CaptchaActionEmail, ctx.ClientIP(), req.CaptchaID, req.CaptchaCode)
+ captchaPass := uc.actionService.ActionRecordVerifyCaptcha(ctx, entity.CaptchaActionPassword, ctx.ClientIP(), req.CaptchaID, req.CaptchaCode)
if !captchaPass {
errFields := append([]*validator.FormErrorField{}, &validator.FormErrorField{
ErrorField: "captcha_code",
@@ -130,7 +130,7 @@ func (uc *UserController) UserEmailLogin(ctx *gin.Context) {
return
}
if !isAdmin {
- uc.actionService.ActionRecordDel(ctx, entity.CaptchaActionEmail, ctx.ClientIP())
+ uc.actionService.ActionRecordDel(ctx, entity.CaptchaActionPassword, ctx.ClientIP())
}
handler.HandleResponse(ctx, nil, resp)
}