@nest-omni/core 1.0.47 → 1.0.49

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.
@@ -14,7 +14,7 @@ function getOmniAuthData(request, key) {
14
14
  const headers = request.headers;
15
15
  let user;
16
16
  const configService = new config_1.ConfigService(request);
17
- if ((0, lodash_1.isEmpty)(headers['x-user-id']) || (0, lodash_1.isEmpty)(headers['x-username'])) {
17
+ if ((0, lodash_1.isEmpty)(headers['x-user-id']) && (0, lodash_1.isEmpty)(headers['x-app-id'])) {
18
18
  if (process.env.NODE_ENV === 'dev') {
19
19
  user = {
20
20
  uid: configService.get('MOCK_UID'),
@@ -26,7 +26,7 @@ function getOmniAuthData(request, key) {
26
26
  };
27
27
  }
28
28
  else {
29
- console.error('User information is not transparently transmitted through the gateway: ' +
29
+ console.debug('User information is not transparently transmitted through the gateway: ' +
30
30
  JSON.stringify(headers));
31
31
  }
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-omni/core",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -55,6 +55,7 @@ class ContextProvider {
55
55
  static getAuthUser() {
56
56
  const auth = ContextProvider.get(ContextProvider.authUserKey);
57
57
  if (!auth) {
58
+ console.error(new Error().stack);
58
59
  throw new common_1.BadGatewayException('User information not found.');
59
60
  }
60
61
  return auth;
@@ -252,13 +252,11 @@ let ApiConfigService = ApiConfigService_1 = class ApiConfigService {
252
252
  transport,
253
253
  level: this.isDev ? 'debug' : 'info',
254
254
  customLogLevel: function (res) {
255
- if (res.statusCode < 300) {
256
- return 'info';
257
- }
258
- else if (res.statusCode >= 300 && res.statusCode < 500) {
255
+ if (res.statusCode >= 500)
256
+ return 'error';
257
+ if (res.statusCode >= 400)
259
258
  return 'warn';
260
- }
261
- return 'error';
259
+ return 'info';
262
260
  },
263
261
  wrapSerializers: true,
264
262
  customProps: (req, res) => {