Skip to content

Commit

Permalink
Don't fetch courses if not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
Keskimaki committed Apr 27, 2023
1 parent 1c70251 commit c99f511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/routes/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) || []

Expand Down

0 comments on commit c99f511

Please sign in to comment.