diff --git a/src/middleware/user.js b/src/middleware/user.js index 6170c8cc00..c9713df9aa 100644 --- a/src/middleware/user.js +++ b/src/middleware/user.js @@ -239,7 +239,7 @@ module.exports = function (middleware) { */ const path = req.path.startsWith('/api/') ? req.path.replace('/api', '') : req.path; - if (req.uid && !(path.endsWith('/edit/email') || path.startsWith('/confirm/'))) { + if (req.uid > 0 && !(path.endsWith('/edit/email') || path.startsWith('/confirm/'))) { const [confirmed, isAdmin] = await Promise.all([ user.getUserField(req.uid, 'email:confirmed'), user.isAdministrator(req.uid),