From a10f247812399ef772e400f8da42227a7b7f65a7 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Wed, 16 Nov 2016 01:23:50 -0300 Subject: [PATCH] Allow to disable recaptcha explicitly by env variable The reason for this is because sometimes in dev enviroments recaptcha will might return a wrong answer, so it's nice to have a way to explicitly disable it --- services/recaptcha.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/recaptcha.go b/services/recaptcha.go index b3eb150..eb420dd 100644 --- a/services/recaptcha.go +++ b/services/recaptcha.go @@ -32,6 +32,9 @@ type recaptchaResponse struct { } func IsHuman(req *http.Request) bool { + if os.Getenv("GOOGLE_RECAPTCHA_DISABLED") != "" { + return true + } req.ParseForm() challenge := req.Form.Get("g-recaptcha-response")