Skip to content

Commit

Permalink
comment some code
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyshnav001 committed Oct 5, 2024
1 parent 1688f4e commit 8db0b87
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/api/verify-order/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { getToken } from "next-auth/jwt";
import { NextRequest, NextResponse } from "next/server";

export async function GET(request: NextRequest, context: { params: { id: string } }) {
const session = await getToken({ req: request, secret: process.env.NEXTAUTH_SECRET });
if (!session) {
return NextResponse.json({ message: "Unauthorized", isOk: false }, { status: 401 });
}
if (session.role !== "ADMIN") {
return NextResponse.json({ message: "Forbidden", isOk: false }, { status: 403 });
}
// const session = await getToken({ req: request, secret: process.env.NEXTAUTH_SECRET });
// if (!session) {
// return NextResponse.json({ message: "Unauthorized", isOk: false }, { status: 401 });
// }
// if (session.role !== "ADMIN") {
// return NextResponse.json({ message: "Forbidden", isOk: false }, { status: 403 });
// }

const { id } = context.params;
try {
Expand Down

0 comments on commit 8db0b87

Please sign in to comment.