@defra/lis-hubs-infra-access 0.12.0 → 0.13.0

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/package.json +8 -8
  2. package/src/auth/oidc.js +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/lis-hubs-infra-access",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Shared hub access and capability resolution for the livestock platform.",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -33,19 +33,19 @@
33
33
  "author": "Defra DDTS",
34
34
  "license": "OGL-UK-3.0",
35
35
  "dependencies": {
36
- "@defra/lis-hubs-infra-core": "^0.4.0",
36
+ "@defra/lis-hubs-infra-core": "^0.5.0",
37
37
  "@defra/lis-hubs-infra-registry": "^0.1.0",
38
- "jose": "6.2.8",
38
+ "convict": "6.2.5",
39
+ "convict-format-with-validator": "6.2.0",
39
40
  "eslint-plugin-jsdoc": "^63.0.8",
40
41
  "eslint-plugin-sonarjs": "^4.1.0",
41
- "neostandard": "0.13.0",
42
- "convict": "6.2.5",
43
- "convict-format-with-validator": "6.2.0"
42
+ "jose": "6.2.8",
43
+ "neostandard": "0.13.0"
44
44
  },
45
45
  "peerDependencies": {
46
- "eslint": "^9.0.0",
47
46
  "@hapi/boom": "10.0.1",
48
- "@hapi/wreck": "18.1.2"
47
+ "@hapi/wreck": "18.1.2",
48
+ "eslint": "^9.0.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@defra/lis-infra-eslint-config": "^0.6.0",
package/src/auth/oidc.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  setHubAuthFlow
11
11
  } from './session.js'
12
12
  import { getReturnUrlFromRequest, sanitizeReturnUrl } from './tokens/index.js'
13
+ import { logger } from '@defra/lis-hubs-infra-core'
13
14
 
14
15
  async function fetchJson(url, options = {}) {
15
16
  const response = await fetch(url, options)
@@ -255,6 +256,9 @@ function createAuthorizationCodeCompleter({
255
256
  providerId: providerConfig.providerId,
256
257
  providerConfig
257
258
  })
259
+ if (user.email) {
260
+ logger.context.set('user_email_hash', user.email, true)
261
+ }
258
262
  const authSession = {
259
263
  ...user,
260
264
  idToken: tokens.id_token,