Skip to content

Commit 66fb4ad

Browse files
committed
feat: add auth guard to commits API route
1 parent 40194d6 commit 66fb4ad

File tree

1 file changed

+3
-2
lines changed
  • packages/web/src/app/api/(server)/commits

1 file changed

+3
-2
lines changed

packages/web/src/app/api/(server)/commits/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { isServiceError } from "@/lib/utils";
44
import { NextRequest } from "next/server";
55
import { schemaValidationError } from "@/lib/serviceError";
66
import { searchCommitsRequestSchema } from "@/features/search/schemas";
7+
import { withOptionalAuthV2 } from "@/withAuthV2";
78

8-
export const POST = async (request: NextRequest) => {
9+
export const POST = async (request: NextRequest) => withOptionalAuthV2(async () => {
910
const body = await request.json();
1011
const parsed = await searchCommitsRequestSchema.safeParseAsync(body);
1112

@@ -22,4 +23,4 @@ export const POST = async (request: NextRequest) => {
2223
}
2324

2425
return Response.json(response);
25-
}
26+
});

0 commit comments

Comments
 (0)