@hmcts/rpx-xui-node-lib 2.29.2-output-stdout → 2.29.3-user-details-log

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.
@@ -3,6 +3,7 @@ import OAuth2Strategy from 'passport-oauth2';
3
3
  import { AxiosResponse } from 'axios';
4
4
  export declare class XUIOAuth2Strategy extends OAuth2Strategy {
5
5
  private readonly options;
6
+ private readonly logger;
6
7
  constructor(options: OAuth2Metadata, verify: OAuth2Strategy.VerifyFunction);
7
8
  userProfile: (accessToken: string, done: (err?: Error | null, profile?: any) => void) => Promise<void>;
8
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"XUIOAuth2Strategy.class.d.ts","sourceRoot":"","sources":["../../../../src/auth/oauth2/models/XUIOAuth2Strategy.class.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,cAAc,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAGrC,qBAAa,iBAAkB,SAAQ,cAAc;IACjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;gBAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,CAAC,cAAc;IAI1E,WAAW,gBAAuB,MAAM,eAAe,KAAK,GAAG,IAAI,YAAY,GAAG,KAAK,IAAI,KAAG,QAAQ,IAAI,CAAC,CAG1G;CACJ;AAED,eAAO,MAAM,cAAc,QAAS,MAAM,aAAa,MAAM,KAAG,QAAQ,aAAa,CAKpF,CAAA"}
1
+ {"version":3,"file":"XUIOAuth2Strategy.class.d.ts","sourceRoot":"","sources":["../../../../src/auth/oauth2/models/XUIOAuth2Strategy.class.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,cAAc,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAGrC,qBAAa,iBAAkB,SAAQ,cAAc;IACjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiD;gBAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,CAAC,cAAc;IAI1E,WAAW,gBAAuB,MAAM,eAAe,KAAK,GAAG,IAAI,YAAY,GAAG,KAAK,IAAI,KAAG,QAAQ,IAAI,CAAC,CAU1G;CACJ;AAED,eAAO,MAAM,cAAc,QAAS,MAAM,aAAa,MAAM,KAAG,QAAQ,aAAa,CAKpF,CAAA"}
@@ -19,9 +19,18 @@ const common_1 = require("../../../common");
19
19
  class XUIOAuth2Strategy extends passport_oauth2_1.default {
20
20
  constructor(options, verify) {
21
21
  super(options, verify);
22
+ this.logger = (0, common_1.getLogger)('auth:XUIOAuth2Strategy');
22
23
  this.userProfile = (accessToken, done) => __awaiter(this, void 0, void 0, function* () {
23
24
  const userDetails = yield (0, exports.getUserDetails)(accessToken, this.options.logoutUrl);
24
- done(null, userDetails.data);
25
+ if (userDetails === null || userDetails === void 0 ? void 0 : userDetails.data) {
26
+ this.logger.log('retrieved userProfile', userDetails.data);
27
+ done(null, userDetails.data);
28
+ }
29
+ else {
30
+ this.logger.error('no user details retrieved');
31
+ const e = new Error('XUIOAuth2Strategy no user details retrieved');
32
+ done(e, null);
33
+ }
25
34
  });
26
35
  this.options = options;
27
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"XUIOAuth2Strategy.class.js","sourceRoot":"","sources":["../../../../src/auth/oauth2/models/XUIOAuth2Strategy.class.ts"],"names":[],"mappings":";AAAA,4DAA4D;;;;;;;;;;;;;;;AAG5D,sEAA4C;AAE5C,4CAAsC;AAEtC,MAAa,iBAAkB,SAAQ,yBAAc;IAEjD,YAAY,OAAuB,EAAE,MAAqC;QACtE,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAG1B,gBAAW,GAAG,C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AI,CAAC,CAAA;gBAC1D,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;aAC/B;iBAAM;gBACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;gBAC9C,MAAM,CAAC,GAAU,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;gBACzE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;aAChB;QACL,CAAC,CAAA,CAAA;QAZG,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC1B,CAAC;CAYJ;AAnBD,8CAmBC;AAEM,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,SAAiB,EAA0B,EAAE;IACrF,MAAM,OAAO,GAAG;QACZ,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,GAAG,EAAE,EAAE;KAC9C,CAAA;IACD,OAAO,aAAI,CAAC,GAAG,CAAC,GAAG,SAAS,UAAU,EAAE,OAAO,CAAC,CAAA;AACpD,CAAC,CAAA;AALY,QAAA,cAAc,kBAK1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmcts/rpx-xui-node-lib",
3
- "version": "2.29.2-output-stdout",
3
+ "version": "2.29.3-user-details-log",
4
4
  "description": "Common nodejs library components for XUI",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index.d.ts",
@@ -68,7 +68,7 @@
68
68
  "eslint-plugin-prettier": "^3.3.1",
69
69
  "husky": "^8.0.0",
70
70
  "jest": "^29.7.0",
71
- "jest-environment-jsdom": "^27.5.1",
71
+ "jest-environment-jsdom": "^29.7.0",
72
72
  "lint-staged": "^10.2.2",
73
73
  "prettier": "^2.0.5",
74
74
  "semantic-release": "^19.0.2",
@@ -87,20 +87,20 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@hapi/joi": "^17.1.1",
90
- "axios": "^0.21.1",
90
+ "axios": "^1.7.7",
91
91
  "caller-path": "^3.0.0",
92
92
  "connect-redis": "^4.0.4",
93
93
  "csurf": "^1.11.0",
94
- "debug": "^4.1.1",
94
+ "debug": "^4.3.7",
95
95
  "deepmerge": "^4.2.2",
96
- "express": "^4.17.1",
96
+ "express": "^4.20.0",
97
97
  "express-session": "^1.17.0",
98
98
  "jest-mock-axios": "^4.7.3",
99
99
  "jest-ts-auto-mock": "^2.1.0",
100
100
  "jwt-decode": "^2.2.0",
101
101
  "openid-client": "^3.10.0",
102
102
  "otplib": "^12.0.1",
103
- "passport": "^0.4.1",
103
+ "passport": "^0.7.0",
104
104
  "passport-oauth2": "^1.5.0",
105
105
  "redis": "^3.0.2",
106
106
  "session-file-store": "^1.5.0",