Getting "Invalid identifier or password" event all the things are right

System Information
  • Strapi 4.8.2:
  • Operating System Mac os:
  • Database Mysql:
  • Node v18.14.0:
  • NPM 9.3.1:

I have created the user with custom routes and my own custom controller where I saved the user detail

 let userCreated = await strapi.entityService.create(
                "plugin::users-permissions.user",
                {
                  data: {
                    username: email,
                    email: email,
                    name: name,
                    password: password,
                    confirmed: true,
                    blocked: false,
                    role: isSeller ? 3 : 1,
                  },
                }
              );

There is no problem in user registration user is created fine

The problem occur when I try to login It shows me an error like

I don’t know why

Most likely since it is saved as an unencrypted value and then put in and encrypted

Add provider: “local” to it will work

let userCreated = await strapi.entityService.create(
                "plugin::users-permissions.user",
                {
                  data: {
                    username: email,
                    email: email,
                    name: name,
                    password: password,
                    provider: "local"
                    confirmed: true,
                    blocked: false,
                    role: isSeller ? 3 : 1,
                  },
                }
              );
2 Likes

good catch I missed that.