M
Mastra•4w ago
divelement

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
Mastra Triager
Mastra Triager•3w ago
šŸ“ 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!
rph
rph•3w ago
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 apiRoutes
Abhi Aiyer
Abhi Aiyer•3w ago
Hi @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...
divelement
divelementOP•3w ago
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.
Abhi Aiyer
Abhi Aiyer•3w ago
Sweet!

Did you find this page helpful?