Search code examples
javascriptnode.jsnpmnode-modulesstrapi

How to overwrite Strapi plugin in Beta version


In the Alpha version, we can edit users-permissions directly inside the plugins folder

I can custom such as register API, login API over here

It seems in Beta version, it will be installed by using package.json and the folder will be inside node_module.

so how can I do if I want to custom these files like using my new field instead email


Solution

  • you can check this docs for the latest beta.

    Basically is creating files with the same structure as the plugin.

    For user-permissions plugin to overwrite the "register" method, you need to create /extensions/users-permissions/controllers/Auth.js and then.

    module.exports = {
      async register(ctx) {
        // Any code you want
       }
    };
    

    And so on for other methods/plugins