From b2bb813020a3c66312142d385daefde87462a326 Mon Sep 17 00:00:00 2001 From: Parminder Singh Date: Wed, 7 Mar 2018 16:34:03 +0530 Subject: [PATCH] Handle POST request on fallback --- .../matrix-org/dendrite/clientapi/routing/auth_fallback.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/auth_fallback.go b/src/github.com/matrix-org/dendrite/clientapi/routing/auth_fallback.go index 13443e238..386b6ceab 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/auth_fallback.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/auth_fallback.go @@ -104,7 +104,7 @@ func AuthFallback( w http.ResponseWriter, req *http.Request, authType string, sessionID string, cfg config.Dendrite, ) *util.JSONResponse { - ServeRecaptcha = func(){ + ServeRecaptcha := func() { data := map[string]string{ "MyUrl": req.URL.String(), "Session": sessionID, @@ -113,7 +113,7 @@ func AuthFallback( ServeTemplate(w, RecaptchaTemplate, data) } - ServeSuccess = func(){ + ServeSuccess := func() { data := map[string]string{} ServeTemplate(w, SuccessTemplate, data) } @@ -131,7 +131,7 @@ func AuthFallback( } else if req.Method == "POST" { clientIP := req.RemoteAddr response := req.Form.Get("g-recaptcha-response") - if err = validateRecaptcha(cfg, response, clientIP), if resErr != nil { + if err := validateRecaptcha(&cfg, response, clientIP); err != nil { ServeRecaptcha() return nil }