openid-client 5.1.7 → 5.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/client.js +4 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -557,13 +557,14 @@ class BaseClient {
557
557
  throw new OPError(params);
558
558
  }
559
559
 
560
- if ('id_token' in params) {
560
+ if (typeof params.id_token === 'string' && params.id_token.length) {
561
561
  throw new RPError({
562
562
  message:
563
563
  'id_token detected in the response, you must use client.callback() instead of client.oauthCallback()',
564
564
  params,
565
565
  });
566
566
  }
567
+ delete params.id_token;
567
568
 
568
569
  const RESPONSE_TYPE_REQUIRED_PARAMS = {
569
570
  code: ['code'],
@@ -608,13 +609,14 @@ class BaseClient {
608
609
  { clientAssertionPayload, DPoP },
609
610
  );
610
611
 
611
- if ('id_token' in tokenset) {
612
+ if (typeof tokenset.id_token === 'string' && tokenset.id_token.length) {
612
613
  throw new RPError({
613
614
  message:
614
615
  'id_token detected in the response, you must use client.callback() instead of client.oauthCallback()',
615
616
  params,
616
617
  });
617
618
  }
619
+ delete tokenset.id_token;
618
620
 
619
621
  return tokenset;
620
622
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openid-client",
3
- "version": "5.1.7",
3
+ "version": "5.1.8",
4
4
  "description": "OpenID Connect Relying Party (RP, Client) implementation for Node.js runtime, supports passportjs",
5
5
  "keywords": [
6
6
  "auth",