Add auth guards to search and discover API routes

This commit is contained in:
2026-03-03 11:13:14 -05:00
parent f6ee32ca1e
commit d5e985efd9
4 changed files with 22 additions and 2 deletions
+2 -1
View File
@@ -8,8 +8,9 @@ export async function POST(req: NextRequest) {
const session = await auth.api.getSession({
headers: await headers(),
});
if (!session)
if (!session) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const body = await req.json();
const { tmdbId, type } = body;