mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 02:23:53 +02:00
add configurable extension backend url and login support
This commit is contained in:
parent
026e653c7a
commit
eb8a9dd1f0
6 changed files with 228 additions and 20 deletions
25
surfsense_web/app/verify-token/route.ts
Normal file
25
surfsense_web/app/verify-token/route.ts
Normal 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",
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue