Clerk Auth w/ Public Routes
This might be a dumb question (sorry if it is), but I'm trying to figure out how to implement public routes with the MastraAuthClerk class. I see that in the experimental_auth config there is a public field but the type makes me think it's either the MastraAuthConfig or the MastraAuthProvider, and I don't see the same option to make a route public. Basically just need to expose a health route. Appreciate any help š
5 Replies
š Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10273
š If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
š Thank you @divelement for helping us improve Mastra!
Hi @divelement While the fix for this is being worked on can you try this work around?
If your health check is a custom route you can use
requiresAuth: false, in the server apiRoutesHi @divelement we have a fix here! https://github.com/mastra-ai/mastra/pull/10284
We'll release it in 0.x and 1.0.0-beta in the next release
GitHub
feat(auth): add public/protected route options to MastraAuthProvide...
Summary
Adds public and protected route configuration options to MastraAuthProviderOptions
Updates MastraAuthProvider base class to store and register these route options
Enables auth providers li...
amazing, y'all are the best. Thanks for the respones @Abhi Aiyer and @rph
seems to be working as of 0.10.8 of the @mastra/auth-clerk package.
Sweet!