Skip to content

Commit

Permalink
add separate message if poll response is not json
Browse files Browse the repository at this point in the history
  • Loading branch information
DrDaveD committed Aug 28, 2020
1 parent 8a4e611 commit 0a614f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions path_oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ func (b *jwtAuthBackend) pathPoll(ctx context.Context, req *logical.Request, d *
return nil, errwrap.Wrapf("error polling for device authorization: {{err}}", err)
}

if body[0] != '{' {
return nil, fmt.Errorf("issuer response while polling for token is not json: %v", string(body))
}

var tokenOrError struct {
*oauth2.Token
Error string `json:"error,omitempty"`
Expand Down

0 comments on commit 0a614f5

Please sign in to comment.