mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
remove redundant code
This commit is contained in:
parent
3c7296ed12
commit
90a9db2fea
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue