Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed admin checks.

Mike Caocb4c8accea05
diff --git a/pages/api/users/[id]/index.ts b/pages/api/users/[id]/index.ts
index cd0332d5b..bbf2e7cbb 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 09f901c03..4abe4353d 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);
}