#Protect all routes using Clerk

1 messages · Page 1 of 1 (latest)

ornate steeple
#

Using Clerk (https://clerk.com/docs/quickstarts/get-started-with-remix), how would one implement a 'global' auth guard, except for the login/signup pages?

Right now I have a helper method I'm calling on every loader on every page, but that feels odd as I have to repeat this on every page. I'd rather have authentication by default with opt-out rather then having no authentication by default with opt-in if that makes sense.

hallow heath
#

There's no way to auth guard your loaders globally with Clerk & Remix doesn't have middlware support yet.

#

You also really want to guard all your loaders individually, since they're just api endpoints, you don't want to accidentally let one be open and expose sensitive data.

ornate steeple