@riocrypto/common-server 1.0.684 → 1.0.685
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,6 +66,7 @@ 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");
|
|
69
70
|
const ACCESS_TOKEN_SECRET = yield secret_manager_client_1.secretManagerClient.getSecretValue("ACCESS_TOKEN_SECRET");
|
|
70
71
|
if (!ACCESS_TOKEN_SECRET) {
|
|
71
72
|
throw new Error("Unable to get ACCESS_TOKEN_SECRET");
|
|
@@ -73,7 +74,9 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
73
74
|
const payload = jsonwebtoken_1.default.verify(req.cookies.accessToken, ACCESS_TOKEN_SECRET);
|
|
74
75
|
req.currentAuth = payload;
|
|
75
76
|
}
|
|
76
|
-
catch (err) {
|
|
77
|
+
catch (err) {
|
|
78
|
+
console.log(err);
|
|
79
|
+
}
|
|
77
80
|
}
|
|
78
81
|
if (!authorizationTypes.includes(common_1.AuthorizationType.UserOptional)) {
|
|
79
82
|
if ((_c = (_b = req.currentAuth) === null || _b === void 0 ? void 0 : _b.missing) === null || _c === void 0 ? void 0 : _c.includes("password")) {
|
|
@@ -139,6 +142,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
139
142
|
}
|
|
140
143
|
if (authorizationTypes.includes(common_1.AuthorizationType.User) ||
|
|
141
144
|
authorizationTypes.includes(common_1.AuthorizationType.UserOptional)) {
|
|
145
|
+
console.log("Getting user 1");
|
|
142
146
|
let user;
|
|
143
147
|
try {
|
|
144
148
|
console.log("Getting user");
|