markjaquith / clerk-sveltekit

Clerk adapter for SvelteKit
Other
128 stars 19 forks source link

More advanced route protection methods #24

Closed markjaquith closed 8 months ago

markjaquith commented 8 months ago

Currently the protectedRoutes option just accepts an array of URL paths, and protects them based on "starts with".

That's a decent default method, because it errs on the side of protecting more (versus exact match). But some people might want to protect /admin but not protect /admin/join, or something.

So it should also accept an array of functions that take the request URL and return a boolean. If any is true, then that request is protected.

hbcondo commented 1 month ago

Could protectedRoutes be updated to support route groups for directories in parentheses?