mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 09:54:00 +00:00
use forwarded host for redirect
This commit is contained in:
@@ -201,8 +201,14 @@ async function findValidSession(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function constructUrl(request: NextRequest, path: string) {
|
function constructUrl(request: NextRequest, path: string) {
|
||||||
|
const forwardedHost = request.headers.get("x-zitadel-forward-host");
|
||||||
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
|
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
|
||||||
return `${basePath}${path}`;
|
return new URL(
|
||||||
|
`${basePath}${path}`,
|
||||||
|
forwardedHost?.startsWith("https://")
|
||||||
|
? forwardedHost
|
||||||
|
: `https://${forwardedHost}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function GET(request: NextRequest) {
|
export async function GET(request: NextRequest) {
|
||||||
|
|||||||
Reference in New Issue
Block a user