From f1d020cff2288f11eaba8510a4f4af8be3465112 Mon Sep 17 00:00:00 2001 From: Markus Ahlstrand Date: Sat, 31 Aug 2024 10:51:38 +0200 Subject: [PATCH] fix to proxy querystring --- .changeset/serious-falcons-raise.md | 5 +++++ apps/auth0-proxy/src/index.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/serious-falcons-raise.md diff --git a/.changeset/serious-falcons-raise.md b/.changeset/serious-falcons-raise.md new file mode 100644 index 0000000..d593b2c --- /dev/null +++ b/.changeset/serious-falcons-raise.md @@ -0,0 +1,5 @@ +--- +"@authhero/auth0-proxy": patch +--- + +Fix to proxy the querystring diff --git a/apps/auth0-proxy/src/index.ts b/apps/auth0-proxy/src/index.ts index 13551f1..40da3f3 100644 --- a/apps/auth0-proxy/src/index.ts +++ b/apps/auth0-proxy/src/index.ts @@ -43,8 +43,10 @@ app.all("*", async (c) => { API_KEY2: string; }>(c); + const sourceUrl = new URL(c.req.url); const targetUrl = new URL(AUTH0_DOMAIN); - targetUrl.pathname = c.req.path; + targetUrl.pathname = sourceUrl.pathname; + targetUrl.search = sourceUrl.search; const headers = new Headers(); for (const [key, value] of c.req.raw.headers.entries()) {