Search code examples
strapi

In Strapi 4, how can I make a custom plugin route accessible to everyone?


I have a custom plugin that creates content-types. I want to be able to pull the created data for those content-types, I first try to access the basic, automatically created route in my plugin

GET /customplugin

But I get 401 unauthorized.

How can I make the route accessible for everyone? (No authorization needed)


Solution

  • https://docs.strapi.io/developer-docs/latest/development/backend-customization/routes.html#public-routes

    To a route object, just add inside the prop config, the prop auth with the value false