I would like to check if the incoming get request has come through public endpoint or through authenticated. Is there a way to check this?
If it is an authenticated request, I would like to show the user more information.
if the request has come via public, then I would like to show the user less information.
The logic I am seeking should do the following (pseudo code)
async findOne(ctx){
const { id } = ctx.params;
let entity = await strapi.services.article.findOne({ id });
// ** conditional logic here **
// if request is authenticated
// show meta data
// Else
// show limited information
return entity;
}
System Information
- Strapi Version: 3.6.5
- Operating System: macOS 12
- Database: Postgress
- Node Version: v14.15
- NPM Version: 6.14