Tool API routes default to being publicly accessible without authentication #5496
Replies: 3 comments 5 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I've noticed the same thing today and I think the docs should be more clear about this behavior. The docs also say that I should use the
My suggestions would be to add something like "All routes in |
Beta Was this translation helpful? Give feedback.
-
I'm facing the same issue here. I want to access a nova custom tool before login. can you please tell me if you were successful? |
Beta Was this translation helpful? Give feedback.
-
Description:
Nova creates all custom tools with API routes that are publicly accessible to unauthenticated users by default.
The tool service provider stub registers routes like this:
The
nova-vendor/my-tool
routes are publicly accessible, and users that should not be able to access Nova or are not even logged in at all can access them in any environment.Detailed steps to reproduce the issue on a fresh Nova installation:
php artisan nova:tool my/tool
and register it with Nova.APP_ENV
toproduction
and update theviewNova
gate to just returnfalse
.Discussion:
Was this intentional? If it wasn't, can Nova's tool stubs be updated to use the
nova:api
middleware group for tool API routes, instead of justnova
? Or should this be documented so that users know they always need to add this? I can't imagine a situation where you would want any of Nova's API routes to be completely public.Beta Was this translation helpful? Give feedback.
All reactions