@riocrypto/common-server 1.0.529 → 1.0.530
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.
|
@@ -50,9 +50,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
if (authorizationTypes.includes(common_1.AuthorizationType.Admin)) {
|
|
53
|
-
if ((_f = req.cookies) === null || _f === void 0 ? void 0 : _f.
|
|
53
|
+
if ((_f = req.cookies) === null || _f === void 0 ? void 0 : _f.adminAccessToken) {
|
|
54
54
|
try {
|
|
55
|
-
const payload = jsonwebtoken_1.default.verify(req.cookies.
|
|
55
|
+
const payload = jsonwebtoken_1.default.verify(req.cookies.adminAccessToken, process.env.JWT_KEY_ADMIN);
|
|
56
56
|
req.currentAdminAuth = payload;
|
|
57
57
|
}
|
|
58
58
|
catch (err) { }
|
|
@@ -7,11 +7,11 @@ exports.currentAdminAuth = void 0;
|
|
|
7
7
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
8
8
|
const currentAdminAuth = (req, res, next) => {
|
|
9
9
|
var _a;
|
|
10
|
-
if (!((_a = req.cookies) === null || _a === void 0 ? void 0 : _a.
|
|
10
|
+
if (!((_a = req.cookies) === null || _a === void 0 ? void 0 : _a.adminAccesToken)) {
|
|
11
11
|
return next();
|
|
12
12
|
}
|
|
13
13
|
try {
|
|
14
|
-
const payload = jsonwebtoken_1.default.verify(req.cookies.
|
|
14
|
+
const payload = jsonwebtoken_1.default.verify(req.cookies.adminAccesToken, process.env.JWT_KEY_ADMIN);
|
|
15
15
|
req.currentAdminAuth = payload;
|
|
16
16
|
}
|
|
17
17
|
catch (err) { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.530",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
25
|
-
"@riocrypto/common": "^1.0.
|
|
25
|
+
"@riocrypto/common": "^1.0.532",
|
|
26
26
|
"@types/express": "^4.17.13",
|
|
27
27
|
"axios": "^0.27.2",
|
|
28
28
|
"ccxt": "^3.0.30",
|