clerk-sveltekit icon indicating copy to clipboard operation
clerk-sveltekit copied to clipboard

`protectedPaths` not protecting routes with hyphens

Open GodTamIt opened this issue 7 months ago • 3 comments

It seems that protectedRoutes does not seem to work with routes that contain hyphens.

For example, this seems to protect the /create route:

export const handle: Handle = sequence(
	handleClerk(CLERK_SECRET_KEY, {
		debug: true,
		protectedPaths: ['/create'],
		signInUrl: '/sign-in'
	})
);

However, this fails to protect the /create-entity route:

export const handle: Handle = sequence(
	handleClerk(CLERK_SECRET_KEY, {
		debug: true,
		protectedPaths: ['/create-entity'],
		signInUrl: '/sign-in'
	})
);

GodTamIt avatar Jul 06 '24 12:07 GodTamIt