@riocrypto/common-server 1.0.685 → 1.0.687
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.
|
@@ -66,7 +66,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
66
66
|
}
|
|
67
67
|
else if ((_a = req.cookies) === null || _a === void 0 ? void 0 : _a.accessToken) {
|
|
68
68
|
try {
|
|
69
|
-
console.log("Getting access token");
|
|
70
69
|
const ACCESS_TOKEN_SECRET = yield secret_manager_client_1.secretManagerClient.getSecretValue("ACCESS_TOKEN_SECRET");
|
|
71
70
|
if (!ACCESS_TOKEN_SECRET) {
|
|
72
71
|
throw new Error("Unable to get ACCESS_TOKEN_SECRET");
|
|
@@ -74,9 +73,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
74
73
|
const payload = jsonwebtoken_1.default.verify(req.cookies.accessToken, ACCESS_TOKEN_SECRET);
|
|
75
74
|
req.currentAuth = payload;
|
|
76
75
|
}
|
|
77
|
-
catch (err) {
|
|
78
|
-
console.log(err);
|
|
79
|
-
}
|
|
76
|
+
catch (err) { }
|
|
80
77
|
}
|
|
81
78
|
if (!authorizationTypes.includes(common_1.AuthorizationType.UserOptional)) {
|
|
82
79
|
if ((_c = (_b = req.currentAuth) === null || _b === void 0 ? void 0 : _b.missing) === null || _c === void 0 ? void 0 : _c.includes("password")) {
|
|
@@ -142,16 +139,13 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
142
139
|
}
|
|
143
140
|
if (authorizationTypes.includes(common_1.AuthorizationType.User) ||
|
|
144
141
|
authorizationTypes.includes(common_1.AuthorizationType.UserOptional)) {
|
|
145
|
-
console.log("Getting user 1");
|
|
146
142
|
let user;
|
|
147
143
|
try {
|
|
148
|
-
console.log("Getting user");
|
|
149
144
|
const User = yield (0, user_1.buildUser)(mongoose);
|
|
150
145
|
user = yield User.findOne({
|
|
151
146
|
authIds: { $in: [req.currentAuth.id] },
|
|
152
147
|
attributes: { $ne: common_1.UserAttribute.deleted },
|
|
153
148
|
});
|
|
154
|
-
console.log("user", user);
|
|
155
149
|
if (!user) {
|
|
156
150
|
throw new Error();
|
|
157
151
|
}
|
|
@@ -167,7 +161,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
167
161
|
user = null;
|
|
168
162
|
}
|
|
169
163
|
if (user) {
|
|
170
|
-
console.log("setting user");
|
|
171
164
|
req.user = user;
|
|
172
165
|
}
|
|
173
166
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.687",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
25
25
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
26
26
|
"@google-cloud/storage": "^6.9.5",
|
|
27
|
-
"@riocrypto/common": "^1.0.
|
|
27
|
+
"@riocrypto/common": "^1.0.624",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|