diff --git a/pages/api/users/[id]/index.ts b/pages/api/users/[id]/index.ts index cd0332d5..bbf2e7cb 100644 --- a/pages/api/users/[id]/index.ts +++ b/pages/api/users/[id]/index.ts @@ -70,7 +70,7 @@ export default async ( } if (req.method === 'DELETE') { - if (isAdmin) { + if (!isAdmin) { return unauthorized(res); } diff --git a/pages/api/users/index.ts b/pages/api/users/index.ts index 09f901c0..4abe4353 100644 --- a/pages/api/users/index.ts +++ b/pages/api/users/index.ts @@ -23,7 +23,7 @@ export default async ( } = req.auth; if (req.method === 'GET') { - if (isAdmin) { + if (!isAdmin) { return unauthorized(res); } @@ -33,7 +33,7 @@ export default async ( } if (req.method === 'POST') { - if (isAdmin) { + if (!isAdmin) { return unauthorized(res); }