@chevre/domain 22.7.0-alpha.7 → 22.7.0-alpha.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.
@@ -96,12 +96,17 @@ class PassportRepo {
96
96
  });
97
97
  }
98
98
  catch (error) {
99
- throw new factory.errors.Argument('Passport Token', `Invalid token: ${error.message}`);
99
+ let message = `Invalid token: ${error.message}`;
100
+ if (error instanceof jwt.JsonWebTokenError) {
101
+ // remove -> 'jwt issuer invalid. expected: [OPTIONS ISSUER]'
102
+ message = message.substring(0, message.indexOf('expected:'));
103
+ }
104
+ throw new factory.errors.Argument('passport.token', message);
100
105
  }
101
106
  // 許可証バリデーション
102
107
  if (typeof this.options.passportValidator === 'function') {
103
108
  if (!this.options.passportValidator({ passport })) {
104
- throw new factory.errors.Argument('Passport Token', 'passportValidator requirement not satisfied');
109
+ throw new factory.errors.Argument('passport.token', 'passportValidator requirement not satisfied');
105
110
  }
106
111
  }
107
112
  // カスタマータイプ決定(2023-11-20~)
package/package.json CHANGED
@@ -108,5 +108,5 @@
108
108
  "postversion": "git push origin --tags",
109
109
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
110
110
  },
111
- "version": "22.7.0-alpha.7"
111
+ "version": "22.7.0-alpha.8"
112
112
  }