How enable auth check when get static form public folder?

System Information
  • Strapi Version - 4.8.2:
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:

Hi, I want restrict access to get uploaded by api data without auth. Try to rewrite config to default public middleware this way:

export default [
    name: 'strapi::public',
    config: {
      auth: true,
  // 'strapi::public',

with no luck.