@adobe/helix-html-pipeline 3.7.2 → 3.7.4

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [3.7.4](https://github.com/adobe/helix-html-pipeline/compare/v3.7.3...v3.7.4) (2022-11-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix NPE if auth cookie is expired ([#192](https://github.com/adobe/helix-html-pipeline/issues/192)) ([47eba7c](https://github.com/adobe/helix-html-pipeline/commit/47eba7c1355bcf967000f7b6cc5065bf8a1bb428))
7
+
8
+ ## [3.7.3](https://github.com/adobe/helix-html-pipeline/compare/v3.7.2...v3.7.3) (2022-11-09)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/mdast-util-gridtables to v1.0.3 ([f060681](https://github.com/adobe/helix-html-pipeline/commit/f0606817661c36fe46f664f15f8ad7770db8a6dd))
14
+
1
15
  ## [3.7.2](https://github.com/adobe/helix-html-pipeline/compare/v3.7.1...v3.7.2) (2022-11-08)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "3.7.2",
3
+ "version": "3.7.4",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@adobe/helix-markdown-support": "6.0.0",
43
43
  "@adobe/helix-shared-utils": "2.1.0",
44
- "@adobe/mdast-util-gridtables": "1.0.2",
44
+ "@adobe/mdast-util-gridtables": "1.0.3",
45
45
  "@adobe/remark-gridtables": "1.0.0",
46
46
  "cookie": "0.5.0",
47
47
  "github-slugger": "2.0.0",
package/src/utils/auth.js CHANGED
@@ -363,12 +363,12 @@ async function getAuthInfoFromCookieOrHeader(state, req) {
363
363
  const { log } = state;
364
364
  let idToken = getAuthCookie(req);
365
365
  if (!idToken) {
366
- log.info('no auth cookie');
366
+ log.debug('no auth cookie');
367
367
  const [marker, value] = (req.headers.get('authorization') || '').split(' ');
368
368
  if (marker.toLowerCase() === 'token' && value) {
369
369
  idToken = value.trim();
370
370
  } else {
371
- log.info('no auth header');
371
+ log.debug('no auth header');
372
372
  }
373
373
  }
374
374
  if (idToken) {
@@ -407,7 +407,7 @@ async function getAuthInfoFromCookieOrHeader(state, req) {
407
407
  return AuthInfo.Default().withCookieInvalid(true);
408
408
  }
409
409
  }
410
- log.info('no id_token');
410
+ log.debug('no id_token');
411
411
  return null;
412
412
  }
413
413
 
@@ -424,6 +424,10 @@ export async function getAuthInfo(state, req) {
424
424
  if (auth.authenticated) {
425
425
  log.info(`[auth] id-token valid: iss=${auth.profile.iss}`);
426
426
  }
427
+ if (!auth.idp) {
428
+ // todo: select idp from config
429
+ auth.withIdp(idpMicrosoft);
430
+ }
427
431
  return auth;
428
432
  }
429
433
  return AuthInfo