Extend core controller "create" for users-permissions user (keep core logic in place)

System Information
  • Strapi Version: 4.11.2
  • Operating System: Mac
  • Database: postgres
  • Node Version: 16 LTS
  • NPM Version: -
  • Yarn Version: -

What I try to reach:

When a new user registers I want to set a required field (uuid) on backend side for the new user entry.

This means I need to hook into the process before the user is created (required field).

I know there is a guide to extend controllers (Controllers | Strapi Documentation) but this seems not to be the case for special case of users in the “users permissions” plugin.

I also know that there is this topic which asks for exactly that: Add controller for "plugin::users-permissions.user" [strapi v4] which links back to: Plugins extension | Strapi Documentation But this does not solve my issue eighter.

I want to keep all the registration logic in place, so in best case I would like to call something like exactly that:

async create(ctx) {
  // some logic here
  const response = await super.create(ctx);
  // some more logic
  return response;
}

But I cannot find any documentation about how to do this for a user from plugin users-permissions.

I hope somebody can provide a working example :slight_smile: