- Strapi Version:
- Operating System:
- Node Version:
- NPM Version:
- Yarn Version:
my users more than 90% don’t use email in china,they usually used Wechat register&login,but i don’t know how to change strapi v4 default identifier from email to phonenumber,please tell me how to change,thanks:grinning:。Excuse me, my English is poor.
im try to setting plugin,but it not work
To switch the main way of identifying users from email to phone number in Strapi v4, follow these steps: First, open the file named “config/auth.json.” Inside this file, locate the property named “identifier” and change its value from “email” to “phone_number.” Make sure to save the file afterward. Once this is done, you’ll need to make a new user by sending a special type of request (called a POST request) to a place in Strapi called “auth/local/register.” This request should include certain information about the user, such as their email address (if available), phone number, and password. Here’s an example of what this request might look like:
“phone_number”: “+86 1234567890”,
If this request works correctly, Strapi will create a new user and send back some information about them. If you’re using an extra tool (called a plugin) to let users log in with their phone numbers, you might need to set up the plugin to use phone numbers instead of emails for identification. The exact steps for doing this can be different depending on which plugin you’re using. Feel free to ask if you need more help!