Can you show me how ca I send an extra param on auth register and use it… I need to catch a role ID to update the new record
post('http://localhost:1337/auth/local/register', {
username: 'Strapi user',
email: 'user@strapi.io',
password: 'strapiPassword',
role: 'parent' or 'roleID'
})
./api/user/models/User.js
module.exports = {
lifecycles: {
async beforeCreate(data) {
console.log(data);
},
async afterCreate(result, data) {
console.log(result);
},
}
};
This example from documentation not working in the ./api/user/models/User.js path… I have to put that in ./extensions/user-permissions/models/User.js
I am trying with a controller too, But I don’t know how to execute the create function to catch the role on the body request… when new user send data…