From 7eb39d779994a72fc0e0440f3a5155043bdfed52 Mon Sep 17 00:00:00 2001 From: Alec Aivazis Date: Sat, 2 Mar 2024 12:36:18 -0800 Subject: [PATCH] use pathname to match routes --- packages/houdini/src/runtime/router/session.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/houdini/src/runtime/router/session.ts b/packages/houdini/src/runtime/router/session.ts index 40ad8a987e..2587cd6ff0 100644 --- a/packages/houdini/src/runtime/router/session.ts +++ b/packages/houdini/src/runtime/router/session.ts @@ -13,12 +13,13 @@ type ServerHandlerArgs = { // so we want a single function that can be called to get the server export async function handle_request(args: ServerHandlerArgs): Promise { const plugin_config = args.config.router ?? {} + const { pathname } = new URL(args.url) // if the project is configured to authorize users by redirect then // we might need to set the session value if ( plugin_config.auth && 'redirect' in plugin_config.auth && - args.url.startsWith(plugin_config.auth.redirect) + pathname.startsWith(plugin_config.auth.redirect) ) { return await redirect_auth(args) }