mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 18:27:25 +08:00
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
This commit is contained in:
parent
7f9cf57f8f
commit
a10f247812
@ -32,6 +32,9 @@ type recaptchaResponse struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsHuman(req *http.Request) bool {
|
func IsHuman(req *http.Request) bool {
|
||||||
|
if os.Getenv("GOOGLE_RECAPTCHA_DISABLED") != "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
req.ParseForm()
|
req.ParseForm()
|
||||||
challenge := req.Form.Get("g-recaptcha-response")
|
challenge := req.Form.Get("g-recaptcha-response")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user