diff --git a/apps/admin/src/index.ts b/apps/admin/src/index.ts index 37fa109b..faad783b 100644 --- a/apps/admin/src/index.ts +++ b/apps/admin/src/index.ts @@ -38,7 +38,7 @@ const start = async () => { }); const isAuthenticated = function (req, res, next) { - if (req.user.role == UserRole.Admin) + if (req.user && req.user.role == UserRole.Admin) return next(); res.redirect('/') }