omniport-backend
omniport-backend copied to clipboard
Handle the case when Multiple user object returned while logging in
This can be a point of discussion, should we return "Invalid credentials" or some more justified message.
Originally posted by @pradumangoyal in https://github.com/IMGIITRoorkee/omniport-backend/pull/127#r498024938
The only condition in which multiple objects would be returned is if one's primary phone number is another's secondary number. So if we get multiple objects, we could filter out the one who's primary phone number matches the given username and return the user if it exists.