From c99f511e8a67930e88cae6bedbad7d9cf13f46d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=20Keskim=C3=A4ki?= Date: Thu, 27 Apr 2023 15:33:56 +0300 Subject: [PATCH] Don't fetch courses if not logged in --- src/server/routes/course.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/routes/course.ts b/src/server/routes/course.ts index 10e74e34..378d36a1 100644 --- a/src/server/routes/course.ts +++ b/src/server/routes/course.ts @@ -8,7 +8,7 @@ const courseRouter = express.Router() courseRouter.get('/', async (req: RequestWithUser, res) => { const { id } = req.user - if (!id) res.send([]) + if (!id || id === 'guest') res.send([]) const courses = (await getCourses(id)) || []