Skip to content

Commit b355faf

Browse files
Merge pull request #172 from KindBear/fix/getKeyFromJWKsURI
fix getting key from response of getKeyFromJWKsURI
2 parents 1e71150 + 77df7af commit b355faf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/OAuthClient.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,7 @@ OAuthClient.prototype.getKeyFromJWKsURI = function getKeyFromJWKsURI(id_token, k
474474
.then((response) => {
475475
if (Number(response.status) !== 200) throw new Error('Could not reach JWK endpoint');
476476
// Find the key by KID
477-
const responseBody = JSON.parse(response.body);
478-
const key = responseBody.keys.find((el) => el.kid === kid);
477+
const key = response.data.keys.find((el) => el.kid === kid);
479478
const cert = this.getPublicKey(key.n, key.e);
480479

481480
return jwt.verify(id_token, cert);

0 commit comments

Comments
 (0)