diff --git a/app/people/route.ts b/app/people/route.ts index 5e2c94b..9fd651b 100644 --- a/app/people/route.ts +++ b/app/people/route.ts @@ -19,12 +19,10 @@ function parseJWT(token: string) { export async function GET(req: NextRequest) { const { searchParams } = new URL(req.url); - const authorization = req.headers.get("authorization"); + const authorization = req.headers.get("Authorization"); if (authorization == null) return new Response(null, { status: 401 }); - const authorized = !!(await prisma.authorizedUsers.findFirst({ - where: { email: parseJWT(authorization.split(" ")[1]).email }, - })); + const authorized = process.env.AUTH_TOKEN === authorization.split(" ")[1]; if (!authorized) return new Response(null, { status: 403 });