From 90a9db2fea61fd5f759a8e91c53297ea76dede6c Mon Sep 17 00:00:00 2001 From: dxl Date: Thu, 27 Oct 2022 10:31:40 +0800 Subject: [PATCH] remove redundant code --- clientapi/routing/register.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index 70d4737ad..8e58d4975 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -384,7 +384,7 @@ func validateRecaptcha( if err != nil { return &util.JSONResponse{ Code: http.StatusInternalServerError, - JSON: jsonerror.BadJSON("Error in unmarshaling captcha server's response: " + err.Error()+"\n"+ string(body) + "\n"+clientip), + JSON: jsonerror.BadJSON("Error in unmarshaling captcha server's response: " + err.Error()), } } @@ -750,8 +750,7 @@ func handleRegistrationFlow( switch r.Auth.Type { case authtypes.LoginTypeRecaptcha: // Check given captcha response - clientIp, _, _ := net.SplitHostPort(req.RemoteAddr) - resErr := validateRecaptcha(cfg, r.Auth.Response, clientIp) + resErr := validateRecaptcha(cfg, r.Auth.Response, req.RemoteAddr) if resErr != nil { return *resErr }