@duvdu-v1/duvdu 1.1.152 → 1.1.153
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.
|
@@ -57,7 +57,14 @@ const isauthenticated = (req, res, next) => __awaiter(void 0, void 0, void 0, fu
|
|
|
57
57
|
catch (error) {
|
|
58
58
|
try {
|
|
59
59
|
const payload = (0, jsonwebtoken_1.verify)(req.session.refresh, process.env.JWT_KEY);
|
|
60
|
-
const user = yield User_model_1.Users.
|
|
60
|
+
const user = yield User_model_1.Users.findOne({
|
|
61
|
+
_id: payload.id,
|
|
62
|
+
refreshTokens: {
|
|
63
|
+
$elemMatch: {
|
|
64
|
+
token: req.session.refresh
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
61
68
|
if (!user)
|
|
62
69
|
return res.status(423).json({ message: 'token expired' });
|
|
63
70
|
if (user.isBlocked.value)
|