Skip to content

Commit

Permalink
fix: handle upstream errors in patreon provider (#3032)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Jan 18, 2023
1 parent 5b88a99 commit 39fa31f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion selfservice/strategy/oidc/provider_patreon.go
Expand Up @@ -96,8 +96,12 @@ func (d *ProviderPatreon) Claims(ctx context.Context, exchange *oauth2.Token, qu
if err != nil {
return nil, errors.WithStack(herodot.ErrInternalServerError.WithReasonf("%s", err))
}

defer res.Body.Close()

if err := logUpstreamError(d.reg.Logger(), res); err != nil {
return nil, err
}

data := PatreonIdentityResponse{}
jsonErr := json.NewDecoder(res.Body).Decode(&data)
if jsonErr != nil {
Expand Down

0 comments on commit 39fa31f

Please sign in to comment.