From dde88c50e2ffe504278f63fee755d5788755a5cb Mon Sep 17 00:00:00 2001 From: Cannon Lock Date: Wed, 18 Sep 2024 14:10:24 -0500 Subject: [PATCH] Add debug logging --- pages/dev/security/+guard.ts | 2 +- server/vike-handler.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/dev/security/+guard.ts b/pages/dev/security/+guard.ts index 967f623b..f0e06e76 100644 --- a/pages/dev/security/+guard.ts +++ b/pages/dev/security/+guard.ts @@ -13,7 +13,7 @@ export const guard: GuardAsync = async ( // Render the login page while preserving the URL. (This is novel technique // which we explain down below.) throw redirect( - `${ingestPrefix}/security/login?return_url=${pageContext.url}` + `${ingestPrefix}/security/login?return_url=${pageContext.urlOriginal}` ); /* The more traditional way, redirect the user: throw redirect('/login') diff --git a/server/vike-handler.ts b/server/vike-handler.ts index 73bec817..7e0dc4ad 100644 --- a/server/vike-handler.ts +++ b/server/vike-handler.ts @@ -18,6 +18,9 @@ export async function vikeHandler< user, macrostratLogoFlavor: macrostratLogoFlavor(), }; + + console.log(pageContextInit); + const pageContext = await renderPage(pageContextInit); const response = pageContext.httpResponse;