@riocrypto/common 1.0.395 → 1.0.396
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.
|
@@ -107,14 +107,19 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
107
107
|
req.user = user;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
+
console.log("checking if user has cookies ", req.cookies);
|
|
110
111
|
if ((_c = req.cookies) === null || _c === void 0 ? void 0 : _c.jwt) {
|
|
112
|
+
console.log("kachao");
|
|
111
113
|
try {
|
|
112
114
|
const payload = jsonwebtoken_1.default.verify(req.cookies.jwt, process.env.JWT_KEY);
|
|
113
115
|
if (authorizationTypes.includes(authorization_type_1.AuthorizationType.User) && !req.user) {
|
|
116
|
+
console.log("kachao1");
|
|
114
117
|
throw new missing_user_error_1.MissingUserError();
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
|
-
catch (err) {
|
|
120
|
+
catch (err) {
|
|
121
|
+
console.log("kachao2");
|
|
122
|
+
}
|
|
118
123
|
}
|
|
119
124
|
if (!req.currentAdminAuth && !req.currentAuth && !req.user) {
|
|
120
125
|
if (missingKYC) {
|