Skip to content

Commit 0a614f5

Browse files
committed
add separate message if poll response is not json
1 parent 8a4e611 commit 0a614f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

path_oidc.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ func (b *jwtAuthBackend) pathPoll(ctx context.Context, req *logical.Request, d *
462462
return nil, errwrap.Wrapf("error polling for device authorization: {{err}}", err)
463463
}
464464

465+
if body[0] != '{' {
466+
return nil, fmt.Errorf("issuer response while polling for token is not json: %v", string(body))
467+
}
468+
465469
var tokenOrError struct {
466470
*oauth2.Token
467471
Error string `json:"error,omitempty"`

0 commit comments

Comments
 (0)