@tabletennisshop/common 1.0.8 → 1.0.10
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.
@@ -8,7 +8,7 @@ const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
8
8
|
const CurrentUserMiddleware = (req, res, next) => {
|
9
9
|
var _a, _b;
|
10
10
|
if (!((_a = req.session) === null || _a === void 0 ? void 0 : _a.jwt)) {
|
11
|
-
console.log("
|
11
|
+
console.log("here2");
|
12
12
|
next();
|
13
13
|
}
|
14
14
|
/*
|
@@ -19,10 +19,13 @@ const CurrentUserMiddleware = (req, res, next) => {
|
|
19
19
|
try {
|
20
20
|
const payload = jsonwebtoken_1.default.verify((_b = req.session) === null || _b === void 0 ? void 0 : _b.jwt, "secretkey");
|
21
21
|
req.currentUser = payload;
|
22
|
+
console.log("here1");
|
22
23
|
}
|
23
24
|
catch (err) {
|
24
25
|
console.log(err);
|
25
26
|
next();
|
26
27
|
}
|
28
|
+
console.log("here3");
|
29
|
+
next();
|
27
30
|
};
|
28
31
|
exports.CurrentUserMiddleware = CurrentUserMiddleware;
|