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