fix: harden editorial registration flow

This commit is contained in:
Leon Tonhäuser committed 2026-08-09 21:04:50 +02:00
1 parent 9b22752ef2
commit a8d4e54ffb
8 files changed
+445 -109

No files matched your search

+20 -1
View File
@@ -1,5 +1,24 @@
import { toNextJsHandler } from "better-auth/next-js";
import { NextResponse } from "next/server";
import { auth } from "@/modules/auth/auth";
export const { GET, POST } = toNextJsHandler(auth);
const handlers = toNextJsHandler(auth);
export const GET = handlers.GET;
export async function POST(
request: Request,
{ params }: { params: Promise<{ all: string[] }> },
): Promise<Response> {
const { all } = await params;
if (all.join("/") === "sign-up/email") {
return NextResponse.json(
{ message: "Bitte verwenden Sie die Registrierung des Redaktionsportals." },
{ status: 403 },
);
}
return handlers.POST(request);
}