Skip to content

Commit

Permalink
use pathname to match routes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed Mar 2, 2024
1 parent c7196b5 commit 7eb39d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/houdini/src/runtime/router/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response | undefined> {
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)
}
Expand Down

0 comments on commit 7eb39d7

Please sign in to comment.