@jayfong/x-server 2.108.2 → 2.108.3
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.
- package/lib/_cjs/services/jwt.js +1 -4
- package/lib/services/jwt.js +1 -4
- package/package.json +1 -1
package/lib/_cjs/services/jwt.js
CHANGED
|
@@ -58,10 +58,7 @@ class JwtService {
|
|
|
58
58
|
if (!authorization) {
|
|
59
59
|
throw new _http_error.HttpError.Unauthorized('header');
|
|
60
60
|
}
|
|
61
|
-
const [scheme, token] = authorization.split(' ');
|
|
62
|
-
if (scheme.toLowerCase() !== 'bearer') {
|
|
63
|
-
throw new _http_error.HttpError.Unauthorized('bearer');
|
|
64
|
-
}
|
|
61
|
+
const [scheme, token = scheme] = authorization.split(' ');
|
|
65
62
|
return this.verify(token);
|
|
66
63
|
}
|
|
67
64
|
}
|
package/lib/services/jwt.js
CHANGED
|
@@ -53,10 +53,7 @@ export class JwtService {
|
|
|
53
53
|
if (!authorization) {
|
|
54
54
|
throw new HttpError.Unauthorized('header');
|
|
55
55
|
}
|
|
56
|
-
const [scheme, token] = authorization.split(' ');
|
|
57
|
-
if (scheme.toLowerCase() !== 'bearer') {
|
|
58
|
-
throw new HttpError.Unauthorized('bearer');
|
|
59
|
-
}
|
|
56
|
+
const [scheme, token = scheme] = authorization.split(' ');
|
|
60
57
|
return this.verify(token);
|
|
61
58
|
}
|
|
62
59
|
}
|