0

I've been working on a Strapi v4 project and would like to customize the authentication flow. Instead of using email as the primary identifier for logging in users, I intend to use a mobile number field that I've added to the user table. I am looking for a way to modify the default Strapi authentication controller to authenticate users with their mobile number and password.

I have successfully set up mobile number validation on my own, so that's not a concern. My main challenge is in changing the authentication logic without altering the existing route ("/auth/local"). I want to retain the endpoint but adjust the internals to accept a mobile number for authentication.

Could you guide me through the necessary steps or point me to the right direction in achieving this customization without introducing a new route?

Thank you for your assistance!

How to Customize Strapi v4 Authentication to Use Mobile Number Instead of Email

asked Jan 27, 2024 at 7:22

1 Answer 1

0

so strapi api login works with both username and email, so while signing up you can save your phone number in username, that you need to handle, so you can then login with that

answered Jan 28, 2024 at 10:39
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.