Compact decoder in verifyAuthCode
This commit is contained in:
parent
45616fa60e
commit
c13a483e32
|
@ -182,10 +182,9 @@ func verifyAuthCode(code, redirectURI, authEndpoint, clientID string) (bool, *au
|
||||||
}
|
}
|
||||||
|
|
||||||
input := io.TeeReader(resp.Body, os.Stderr)
|
input := io.TeeReader(resp.Body, os.Stderr)
|
||||||
dec := json.NewDecoder(input)
|
|
||||||
var authResponse authResponse
|
var authResponse authResponse
|
||||||
err = dec.Decode(&authResponse)
|
if err := json.NewDecoder(input).Decode(&authResponse); err != nil {
|
||||||
if err != nil {
|
|
||||||
return false, nil, fmt.Errorf("while verifying authentication response from %s: %s", authEndpoint, err)
|
return false, nil, fmt.Errorf("while verifying authentication response from %s: %s", authEndpoint, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user