How (Log in page)? - Single input that validates & accepts phone or email

I want users to be able to enter their mobile number or email when signing in (along with password). Ideally, they can do this in a single input.

Screen Shot 2023-03-18 at 2.22.06 pm

Thanks :slight_smile:

One way to approach this could be as follows:

Email: run logic that looks for the @ sign so that the email can be treated as such. Action to use would be “sign the user up”

Phone: now that we know that it is not an email then it must be a phone. Treat it like a text field. Action to use “create an account for someone else” where you create dummy emails and record the phone number. When a user comes back to login at a later time when he/she enters their phone number do a search to find the user that has this phone number.

Watch for the need to possibly validate the email and the phone number. But this is logic that you worry about later on. For an MVP accepting unvalidated emails/phoneNumbers should be ok.

This topic was automatically closed after 70 days. New replies are no longer allowed.