Skip to content

Commit b1816e0

Browse files
committedOct 13, 2017
Send recaptcha response
1 parent edbac11 commit b1816e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎auth/auth.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ func (c *Config) authenticate(client *http.Client, cookies cookies, uri, user, p
215215
query.Add("username", user)
216216
query.Add("password", pass)
217217
query.Add("csrf", csrf)
218+
query.Add("g-recaptcha-response", "")
218219

219220
req, err := http.NewRequest("POST", uri, strings.NewReader(query.Encode()))
220221
if err != nil {
@@ -233,7 +234,8 @@ func (c *Config) authenticate(client *http.Client, cookies cookies, uri, user, p
233234
}
234235

235236
if res.StatusCode != 302 {
236-
return "", errors.New("status = " + res.Status)
237+
body, _ := ioutil.ReadAll(res.Body)
238+
return "", errors.New("status = " + res.Status + ", response = " + string(body))
237239
}
238240

239241
// Follow redirect to hydra

0 commit comments

Comments
 (0)
Please sign in to comment.