From 28771d5c88ca0929b7e6a201bc9781d4761b1fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 26 Jan 2023 21:25:54 -0500 Subject: [PATCH] fix: regression from user helper refactor --- src/controllers/accounts/edit.js | 2 +- src/controllers/accounts/info.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/accounts/edit.js b/src/controllers/accounts/edit.js index 2009ff98f9..84763a6e71 100644 --- a/src/controllers/accounts/edit.js +++ b/src/controllers/accounts/edit.js @@ -105,7 +105,7 @@ editController.email = async function (req, res, next) { async function renderRoute(name, req, res) { const [isAdmin, { username, userslug }, hasPassword] = await Promise.all([ - privileges.admin.can('admin:users', res.locals.uid), + privileges.admin.can('admin:users', req.uid), user.getUserFields(res.locals.uid, ['username', 'userslug']), user.hasPassword(res.locals.uid), ]); diff --git a/src/controllers/accounts/info.js b/src/controllers/accounts/info.js index 2b60ba9212..1f73c412e1 100644 --- a/src/controllers/accounts/info.js +++ b/src/controllers/accounts/info.js @@ -15,7 +15,7 @@ infoController.get = async function (req, res) { const [{ username, userslug }, isPrivileged] = await Promise.all([ user.getUserFields(res.locals.uid, ['username', 'userslug']), - user.isPrivileged(res.locals.uid), + user.isPrivileged(req.uid), ]); const [history, sessions, usernames, emails, notes] = await Promise.all([ user.getModerationHistory(res.locals.uid),