@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
|
-
|
|
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('
|
|
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