@aeriajs/server 0.0.286 → 0.0.287
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/dist/getToken.js +4 -1
- package/package.json +4 -4
package/dist/getToken.js
CHANGED
|
@@ -12,9 +12,12 @@ export const getToken = async (request, context) => {
|
|
|
12
12
|
sub: null,
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
const decodedToken = await decodeToken(typeof request.headers.authorization === 'string'
|
|
15
|
+
const { error, result: decodedToken } = await decodeToken(typeof request.headers.authorization === 'string'
|
|
16
16
|
? request.headers.authorization.split('Bearer ').at(-1)
|
|
17
17
|
: '');
|
|
18
|
+
if (error) {
|
|
19
|
+
return Result.error(error);
|
|
20
|
+
}
|
|
18
21
|
if (authenticationGuard(decodedToken)) {
|
|
19
22
|
if (typeof decodedToken.sub === 'string') {
|
|
20
23
|
decodedToken.sub = new ObjectId(decodedToken.sub);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.287",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"mongodb": "^6.18.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@aeriajs/core": "^0.0.
|
|
36
|
-
"@aeriajs/builtins": "^0.0.
|
|
35
|
+
"@aeriajs/core": "^0.0.285",
|
|
36
|
+
"@aeriajs/builtins": "^0.0.285",
|
|
37
37
|
"@aeriajs/common": "^0.0.161",
|
|
38
38
|
"@aeriajs/entrypoint": "^0.0.169",
|
|
39
39
|
"@aeriajs/http": "^0.0.200",
|
|
40
40
|
"@aeriajs/node-http": "^0.0.200",
|
|
41
|
-
"@aeriajs/server": "^0.0.
|
|
41
|
+
"@aeriajs/server": "^0.0.287",
|
|
42
42
|
"@aeriajs/types": "^0.0.137",
|
|
43
43
|
"mongodb": "^6.18.0"
|
|
44
44
|
},
|