Authenticate with mobile number(duplicate mobile number)

36 views
Skip to first unread message

lakshitha kumara

unread,
May 27, 2018, 8:02:25 AM5/27/18
to Django users
Hello guys

I have some issue in user Authenticate System for example there are tow country called X and Y this two country phone code is +9 and +10 (this is only for example) . this two country have two people name called R and M. R person mobile is +9123456789 and M person mobile number is +10123456789.

There are site called P and this two user come to register on that site and enter the mobile number. both people enter the mobile number without country code but this site get user country code via ip address.

But problem is if we save mobile number as what user enter mobile number field will be duplicate. and if save with country code user don't know about it and next time once he came and enter the same mobile number he entered before system will say invalid mobile number.

i would like to know best way bypass this method . most of websites have this issue.

Thanks

Jason

unread,
May 27, 2018, 1:31:33 PM5/27/18
to Django users
from my perspective: you can do two things.  First and easiest, is to have the user include the country code when registering.  So if they get a duplicate phone number, that's not your fault.  Second, and more complicated, is to use a pre-save db signal to execute the user country lookup by IP and transform the phone number before the db insert happens.

lakshitha kumara

unread,
May 27, 2018, 11:44:56 PM5/27/18
to Django users
Hello Jason,

Thank you fro your suggestion. but thing is im getting mobile number like this .


user can enter the email or mobile number. if user enter mobile number with country code that fine if not then i get user country code via ip and validate mobile number. then i save two first one is user enter mobile number. so it can with country code or without. the problem is if country code not there can be duplicate number i can save number with country code if user not enter the country code because next login user will not enter the country code so then that user cant login. 

look like i only option is saving mobile number with country code and once user enter the mobile number without country code then search db LIKE and if match with password login to the system.

Thanks
Reply all
Reply to author
Forward
0 new messages