Fix logout redirect to 0.0.0.0 instead of configured BASE_URL

Closes #113

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
fuomag9
2026-04-20 09:51:40 +02:00
parent 521a059414
commit dbfc340ea4
2 changed files with 21 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import { getAuth } from "@/src/lib/auth-server";
import { checkSameOrigin } from "@/src/lib/auth";
import { config } from "@/src/lib/config";
import { headers } from "next/headers";
export const dynamic = "force-dynamic";
@@ -10,5 +11,5 @@ export async function POST(request: NextRequest) {
if (originCheck) return originCheck;
await getAuth().api.signOut({ headers: await headers() });
return NextResponse.redirect(new URL("/login", request.url));
return NextResponse.redirect(new URL("/login", config.baseUrl));
}