Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Once the model is cached, auth is neglected #41

@divyagowda

Description

@divyagowda

Hi,

I integrated the strapi middleware cache to my project and added the model like categories. Below is my cache settings in middleware.js under config
cache: {
enabled: true,
type: 'redis',
maxAge: 3600000,
models: [
{
model: 'Categories',
maxAge: 1000000,
}
],
populateStrapiMiddleware: true,
logs:true
}
First time when GET /Categories api is invoked it asked for bearer token. Next time when it is cached authentication is totally ignored. If I remove auth header no forbidden message is shown instead data is returned giving access to anybody with api. Am I missing any steps? How to overcome this problem so that cache middleware is not invoked before auth is verified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions