Merge pull request #857 from aleksas/extension-login-minimal-pr

add configurable extension backend url and login support
This commit is contained in:
Rohan Verma 2026-03-03 23:41:55 -08:00 committed by GitHub
commit 7df64b5c9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 228 additions and 20 deletions

View file

@ -0,0 +1,25 @@
import { NextRequest, NextResponse } from "next/server";
const backendBaseUrl = (process.env.INTERNAL_FASTAPI_BACKEND_URL || "http://backend:8000").replace(
/\/+$/,
""
);
export async function GET(request: NextRequest) {
const response = await fetch(`${backendBaseUrl}/verify-token`, {
method: "GET",
headers: {
Authorization: request.headers.get("authorization") || "",
"X-API-Key": request.headers.get("x-api-key") || "",
},
cache: "no-store",
});
return new NextResponse(response.body, {
status: response.status,
headers: {
"content-type": response.headers.get("content-type") || "application/json",
"cache-control": "no-store",
},
});
}