1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-12 08:40:04 +00:00

chore: fix specs

This commit is contained in:
2023-05-10 14:35:35 +05:00
parent 6c88eeabd2
commit 3f815e9beb
9 changed files with 98 additions and 44 deletions

View File

@@ -8,8 +8,8 @@ export const verifyAdminIfNeeded: RequestHandler = (req, res, next) => {
if (!user?.isAdmin) {
let adminAccountRequired: boolean = true
if (req.params.userId) {
adminAccountRequired = user?.userId !== req.params.userId
if (req.params.uid) {
adminAccountRequired = user?.userId !== req.params.uid
} else if (req.params.username) {
adminAccountRequired = user?.username !== req.params.username
}