From 090a792168d798f78cf711599edd101f34cc3d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 18 Jun 2023 18:42:49 -0400 Subject: [PATCH] fix: #11729, only check registered users ignore guests(uid 0) & spiders(uid -1) --- src/middleware/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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),