Decoupled JWT from DB

This commit is contained in:
Alex Holliday committed 2024-08-10 10:20:06 -07:00
1 parent 14f6f05dfc
commit 0cc7751d2e
5 files changed
+16 -7

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ const verifyJWT = (req, res, next) => {
if (err) {
try {
const userId = jwt.decode(parsedToken)._id;
await User.updateOne({ _id: userId }, { $unset: { authToken: null } });
await req.db.logoutUser(userId);
logger.error(errorMessages.INVALID_AUTH_TOKEN, {
service: SERVICE_NAME,
});