We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protectedPaths
It seems that protectedRoutes does not seem to work with routes that contain hyphens.
protectedRoutes
For example, this seems to protect the /create route:
/create
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:
/create-entity
export const handle: Handle = sequence( handleClerk(CLERK_SECRET_KEY, { debug: true, protectedPaths: ['/create-entity'], signInUrl: '/sign-in' }) );
The text was updated successfully, but these errors were encountered:
This feels like the correct behavior to me- it's comparing path segments rather than the string of the whole path
Sorry, something went wrong.
@pensono hmm, I'm a bit confused then. How would one protect a path named /create-entity then? Or is that not possible?
@GodTamIt Would either of these work?
handleClerk(CLERK_SECRET_KEY, { // ... protectedPaths: ['/create-entity', '/create-other-entity'], })
or
handleClerk(CLERK_SECRET_KEY, { // ... protectedPaths: [ (event) => event.route.id != null && !event.route.id.startsWith('/create-') ], })
No branches or pull requests
It seems that
protectedRoutes
does not seem to work with routes that contain hyphens.For example, this seems to protect the
/create
route:However, this fails to protect the
/create-entity
route:The text was updated successfully, but these errors were encountered: