From bc37a5c51656a20affd8745fa860b5a8bfa023d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 19 Aug 2022 08:51:04 -0400 Subject: [PATCH] fix: parseInt caller.uid closes #10849 --- src/api/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/users.js b/src/api/users.js index aa1ea25687..abc295acfd 100644 --- a/src/api/users.js +++ b/src/api/users.js @@ -305,7 +305,7 @@ async function isPrivilegedOrSelfAndPasswordMatch(caller, data) { async function processDeletion({ uid, method, password, caller }) { const isTargetAdmin = await user.isAdministrator(uid); - const isSelf = parseInt(uid, 10) === caller.uid; + const isSelf = parseInt(uid, 10) === parseInt(caller.uid, 10); const isAdmin = await user.isAdministrator(caller.uid); if (isSelf && meta.config.allowAccountDelete !== 1) {