feat: disable captcha for local dev

This commit is contained in:
Yanislav Igonin 2022-02-09 09:18:51 +02:00
parent 672e82d06e
commit 2f9e26d799

View File

@ -119,6 +119,7 @@ func CreateThread(c *gin.Context) {
return return
} }
if Config.App.IsCaptchaActive {
captchaID := form.Value["captchaId"][0] captchaID := form.Value["captchaId"][0]
captchaString := form.Value["captcha"][0] captchaString := form.Value["captcha"][0]
isCaptchaValid := captcha.VerifyString(captchaID, captchaString) isCaptchaValid := captcha.VerifyString(captchaID, captchaString)
@ -129,6 +130,7 @@ func CreateThread(c *gin.Context) {
c.HTML(http.StatusBadRequest, "400.html", errorHtmlData) c.HTML(http.StatusBadRequest, "400.html", errorHtmlData)
return return
} }
}
conn, err := Db.Pool.Acquire(context.TODO()) conn, err := Db.Pool.Acquire(context.TODO())
if err != nil { if err != nil {
@ -279,6 +281,7 @@ func UpdateThread(c *gin.Context) {
return return
} }
if Config.App.IsCaptchaActive {
captchaID := form.Value["captchaId"][0] captchaID := form.Value["captchaId"][0]
captchaString := form.Value["captcha"][0] captchaString := form.Value["captcha"][0]
isCaptchaValid := captcha.VerifyString(captchaID, captchaString) isCaptchaValid := captcha.VerifyString(captchaID, captchaString)
@ -289,6 +292,7 @@ func UpdateThread(c *gin.Context) {
c.HTML(http.StatusBadRequest, "400.html", errorHtmlData) c.HTML(http.StatusBadRequest, "400.html", errorHtmlData)
return return
} }
}
isSageField := form.Value["sage"] isSageField := form.Value["sage"]
var isSageString string var isSageString string