I've edited a global middleware which gets author data to each operations to make some verifications. But I don't have access to ctx.state.user in that middleware.
module.exports = (config, { strapi }) => {
return async (ctx, next) => {
console.log(ctx.state.user);
return next();
};
};
I've tried to access it even in some lifecycle files, but it's the same thing.
When I console.log(ctx.state), it returns {} an empty object so I cannot access to ctx.state.user
Documentation didn't help me
Thanks in advance for any help
The answer is from Jwt token.