Override "auth.js" and "user.js" (in "controllers") within "plugin-users-permissions" completely šŸ¤”

System Information
  • Strapi Version: 4.21.1
  • Operating System: Heroku
  • Database: PostgreSQL
  • Node Version: 18.20.0
  • NPM Version: >=6.0.0

Hello guys,

I have extensively modified the files ā€œauth.jsā€ and ā€œuser.jsā€ (in ā€œcontrollersā€) within ā€œplugin-users-permissionsā€, and I have bound them via ā€œstrapi-server.jsā€.

image

Here are the two files with which I want to completely override the system functions:

image

But the program is not running yet because the following two lines are not functioning:

image

Could someone perhaps give me a tip on how to write this part correctly? :thinking:

Many thanks in advance!

I solved the problem myself by copying and adding more files from the original.

1 Like

Hey @mingxi
thanks for your solution. I tried to follow your steps but with no luck can you shared detailed files of the overriten files :smiley:
thank you