mirror of
https://github.com/strapi/strapi.git
synced 2025-08-31 04:03:50 +00:00
Only allow registeration with specific fields
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: diogotcorreia
This commit is contained in:
parent
6a6d53b402
commit
a927f7e19b
@ -394,9 +394,10 @@ module.exports = {
|
||||
);
|
||||
}
|
||||
|
||||
const params = _.assign(ctx.request.body, {
|
||||
const params = {
|
||||
..._.pick(ctx.request.body, ['username', 'email', 'password']),
|
||||
provider: 'local',
|
||||
});
|
||||
};
|
||||
|
||||
// Password is required.
|
||||
if (!params.password) {
|
||||
@ -580,14 +581,14 @@ module.exports = {
|
||||
{ confirmed: true }
|
||||
);
|
||||
|
||||
if(returnUser) {
|
||||
if (returnUser) {
|
||||
ctx.send({
|
||||
jwt: strapi.plugins['users-permissions'].services.jwt.issue({
|
||||
id: user.id
|
||||
id: user.id,
|
||||
}),
|
||||
user: sanitizeEntity(user.toJSON ? user.toJSON() : user, {
|
||||
model: strapi.query('user', 'users-permissions').model
|
||||
})
|
||||
model: strapi.query('user', 'users-permissions').model,
|
||||
}),
|
||||
});
|
||||
} else {
|
||||
const settings = await strapi
|
||||
|
Loading…
x
Reference in New Issue
Block a user