I was able to fix it myself by editing the extensions/users-permissions/server/controllers/auth.js file.