System Information
- Strapi Version: 4.1.7
- Operating System: macOS Monterey
- Database: PostgreSql
- Node Version: v14.19.0
- NPM Version: 6.14.16
- Yarn Version: 1.22.15
Hello!
I have a strange problem with creating users.
I created custom API using strapi generate.
In that API I am creating new users with this code:
let newUser = {
username: phoneNumber,
email: phoneNumber + "@example.com",
password: smsCode.toString(),
};
let user = await strapi.entityService.create(“plugin::users-permissions.user”, {
data: newUser,
});
where username is phone number - +79999999999
and password is code from SMS.
The user is created in the database and I can see him in Strapi Admin,
but, when I trying to login with this data, using /api/auth/local, I am getting error - Invalid identifier or password.
But if I create user with the same data in Strapi Admin, all is fine, and I can login with this data.
What can be a reason of this problem?