From 770916492e463c389ba02c6c1ec8d172939313fb Mon Sep 17 00:00:00 2001 From: Tzahi12345 Date: Mon, 17 Apr 2023 23:56:52 -0400 Subject: [PATCH] Fixed authentication error in notifications (2) --- backend/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app.js b/backend/app.js index 2b6ba9e..90e5ccd 100644 --- a/backend/app.js +++ b/backend/app.js @@ -2031,7 +2031,7 @@ app.post('/api/changeRolePermissions', optionalJwt, async (req, res) => { // notifications app.post('/api/getNotifications', optionalJwt, async (req, res) => { - const uuid = req.user.uid; + const uuid = req.isAuthenticated() ? req.user.uid : null; const notifications = await db_api.getRecords('notifications', {user_uid: uuid});