mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
feat: disable captcha for local dev
This commit is contained in:
parent
672e82d06e
commit
2f9e26d799
@ -119,15 +119,17 @@ func CreateThread(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
captchaID := form.Value["captchaId"][0]
|
if Config.App.IsCaptchaActive {
|
||||||
captchaString := form.Value["captcha"][0]
|
captchaID := form.Value["captchaId"][0]
|
||||||
isCaptchaValid := captcha.VerifyString(captchaID, captchaString)
|
captchaString := form.Value["captcha"][0]
|
||||||
if !isCaptchaValid {
|
isCaptchaValid := captcha.VerifyString(captchaID, captchaString)
|
||||||
errorHtmlData := Repositories.BadRequestHtmlData{
|
if !isCaptchaValid {
|
||||||
Message: Repositories.InvalidCaptchaErrorMessage,
|
errorHtmlData := Repositories.BadRequestHtmlData{
|
||||||
|
Message: Repositories.InvalidCaptchaErrorMessage,
|
||||||
|
}
|
||||||
|
c.HTML(http.StatusBadRequest, "400.html", errorHtmlData)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
c.HTML(http.StatusBadRequest, "400.html", errorHtmlData)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
conn, err := Db.Pool.Acquire(context.TODO())
|
conn, err := Db.Pool.Acquire(context.TODO())
|
||||||
@ -279,15 +281,17 @@ func UpdateThread(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
captchaID := form.Value["captchaId"][0]
|
if Config.App.IsCaptchaActive {
|
||||||
captchaString := form.Value["captcha"][0]
|
captchaID := form.Value["captchaId"][0]
|
||||||
isCaptchaValid := captcha.VerifyString(captchaID, captchaString)
|
captchaString := form.Value["captcha"][0]
|
||||||
if !isCaptchaValid {
|
isCaptchaValid := captcha.VerifyString(captchaID, captchaString)
|
||||||
errorHtmlData := Repositories.BadRequestHtmlData{
|
if !isCaptchaValid {
|
||||||
Message: Repositories.InvalidCaptchaErrorMessage,
|
errorHtmlData := Repositories.BadRequestHtmlData{
|
||||||
|
Message: Repositories.InvalidCaptchaErrorMessage,
|
||||||
|
}
|
||||||
|
c.HTML(http.StatusBadRequest, "400.html", errorHtmlData)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
c.HTML(http.StatusBadRequest, "400.html", errorHtmlData)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isSageField := form.Value["sage"]
|
isSageField := form.Value["sage"]
|
||||||
|
Loading…
Reference in New Issue
Block a user