From 91f1d73295b933f53d3272e5913229bdae06c98e Mon Sep 17 00:00:00 2001 From: reya Date: Tue, 23 Jan 2024 14:15:50 +0700 Subject: [PATCH] fix --- src/daemon/web/authorize.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/daemon/web/authorize.ts b/src/daemon/web/authorize.ts index 73afeed..240d92f 100644 --- a/src/daemon/web/authorize.ts +++ b/src/daemon/web/authorize.ts @@ -49,7 +49,8 @@ export async function authorizeRequestWebHandler(request, reply) { const record = await getAndValidateStateOfRequest(request); const url = new URL(request.url, `http://${request.headers.host}`); const callbackUrl = url.searchParams.get("callbackUrl"); - const baseUrl = new URL(request.url).pathname.replace(/\/+$/, ''); + console.log(request) + const baseUrl = new URL(request.originalUrl).pathname.replace(/\/+$/, ''); const method = record.method; let nip05: string | undefined; @@ -164,7 +165,7 @@ export async function processRegistrationWebHandler(request, reply) { try { const record = await getAndValidateStateOfRequest(request); const body = request.body; - const baseUrl = new URL(request.url).pathname.replace(/\/+$/, ''); + const baseUrl = new URL(request.originalUrl).pathname.replace(/\/+$/, ''); // we serialize the payload again and store it // along with the allowed flag