System Information
-
Strapi Version:
4.5.3 -
Operating System:
Windows - production is Heroku -
Database:
MySQL
I am trying to create a new frontend user through an API.
I am able to add a new entry to to the user model with entityService but then I can’t log on with that user.
I have tried about 50 different things and been searching Google for about 20 hours already but I can’t find the answer. I am currently searching through the Github and node_modules.
Here is my code:
const pw = await auth.hashPassword("testtest");
console.log(pw);
let newUser = await strapi.entityService.create(
"plugin::users-permissions.user",
{
data: {
username: Email,
email: Email,
password: pw,
provider: 'local',
confirmed: true,
OrganizationName: OrganizationName,
OrganizationId: organizationId,
TypeOfRegistration: "Admin",
role: userPerm.id,
FullName: Name,
UserId: uuidv4(),
},
}
);