@riocrypto/common 1.0.422 → 1.0.424
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.
|
@@ -26,7 +26,7 @@ const missing_password_error_1 = require("../errors/missing-password-error");
|
|
|
26
26
|
const missing_security_question_error_1 = require("../errors/missing-security-question-error");
|
|
27
27
|
const admin_only_error_1 = require("../errors/admin-only-error");
|
|
28
28
|
const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
29
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
30
30
|
let missingKYC = false;
|
|
31
31
|
if (authorizationTypes.includes(authorization_type_1.AuthorizationType.Auth) ||
|
|
32
32
|
authorizationTypes.includes(authorization_type_1.AuthorizationType.UserNoKYC) ||
|
|
@@ -138,7 +138,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
138
138
|
}
|
|
139
139
|
if (authorizationTypes.includes(authorization_type_1.AuthorizationType.Admin) &&
|
|
140
140
|
authorizationTypes.length === 1 &&
|
|
141
|
-
|
|
141
|
+
((_h = req.cookies) === null || _h === void 0 ? void 0 : _h.jwt)) {
|
|
142
142
|
throw new admin_only_error_1.AdminOnlyError();
|
|
143
143
|
}
|
|
144
144
|
throw new not_authorized_error_1.NotAuthorizedError();
|