Hi! How can I access FormData in a policy file? I’m trying to make that users can only update their avatar:
module.exports = async (ctx, next) => {
if (ctx.state.user != ctx.res.body.refId) {
return await next();
}
ctx.unauthorized();
};
ctx.res.body and ctx.res.data return undefined.
I’ve also tried to check for user id in the Upload.js controller, but it doesn’t seem to have access to ctx as it returns undefined