Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m trying to implement a phone number based login and not sure if I should ask

ID: 652047 • Letter: I

Question

I'm trying to implement a phone number based login and not sure if I should ask the users for full number, i.e country code + number or just the number.

What I have in mind so far:

Attempt optimistic login using whatever number user gives.
Most likely, it'll come back with a single user match.
In case there is a collision, throw an error (and show some helpful clue to the user asking them to enter full number)
I guess this is a simplistic approach with minimum friction and complexity (as opposed to IP detection, geography based resolution etc.).

Explanation / Answer

You should make them enter the whole thing in one step, and you should make the format explicit.

That said, I think you're setting yourself up for a disaster, because there are many issues to consider: