Sanitization: Unable to sanitize users-permissions.user

After verifying that indeed sanitizeEntity does not exist on @strapi/utils and following a bit more research I found

const { sanitizeEntity } = require('strapi-utils');
...
        return sanitizeEntity(entity, { model: strapi.getModel('plugin::users-permissions.user') });

You may have to install strapi-utils

1 Like