ignore captcha when creatig new reply

This commit is contained in:
Tim Schuster 2020-04-22 07:26:29 +02:00
parent dea4148f4b
commit 6959b2e816
1 changed files with 9 additions and 6 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt"
"github.com/pressly/chi"
"github.com/tidwall/buntdb"
"go.rls.moe/nyx/config"
"go.rls.moe/nyx/http/errw"
"go.rls.moe/nyx/http/middle"
"go.rls.moe/nyx/resources"
@ -24,6 +25,7 @@ func handleNewReply(w http.ResponseWriter, r *http.Request) {
return
}
if middle.GetConfig(r).Captcha.Mode != config.CaptchaDisabled {
if !resources.VerifyCaptcha(r) {
http.Redirect(w, r,
fmt.Sprintf("/%s/%s/thread.html?err=wrong_captcha",
@ -31,6 +33,7 @@ func handleNewReply(w http.ResponseWriter, r *http.Request) {
http.StatusSeeOther)
return
}
}
var reply = &resources.Reply{}