Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Followers] Lookup Phone Number #49

Open
MichaelSlatteryDev opened this issue Sep 6, 2022 · 5 comments
Open

[Followers] Lookup Phone Number #49

MichaelSlatteryDev opened this issue Sep 6, 2022 · 5 comments
Assignees

Comments

@MichaelSlatteryDev
Copy link
Collaborator

For the followers feature in the future the backend needs to be able to use a phone number from a users contacts to fetch userIds. We store the users phone number with Firebase Authentication. It seems the userId across the backend and Firebase is the same so assuming we can fetch users from Firebase using their phone number it should then be simple to do the rest in the backend with the findUserByIdOrFail function.

@gnoulelem gnoulelem self-assigned this Sep 8, 2022
@gnoulelem
Copy link
Collaborator

I added a new method findUserByPhoneNumber in the Authentication service to retrieve a user from Firebase by providing his phone number.
For doing so I used the getUserByPhoneNumber method provide by Firebase admin SDK.

getAuth() .getUserByPhoneNumber(phoneNumber)

We can also get several users with the getUsers method

getAuth() .getUsers([ { uid: 'uid1' }, { email: '[email protected]' }, { phoneNumber: '+15555550003' }, { providerId: 'google.com', providerUid: 'google_uid4' }, ])

@Xazin
Copy link
Member

Xazin commented Oct 18, 2022

I added a new method findUserByPhoneNumber in the Authentication service to retrieve a user from Firebase by providing his phone number. For doing so I used the getUserByPhoneNumber method provide by Firebase admin SDK.

getAuth() .getUserByPhoneNumber(phoneNumber)

We can also get several users with the getUsers method

getAuth() .getUsers([ { uid: 'uid1' }, { email: '[email protected]' }, { phoneNumber: '+15555550003' }, { providerId: 'google.com', providerUid: 'google_uid4' }, ])

Can you push your branch, and let's make a PR for this, then I will start mapping out what more we need for this feature that we currently know of.

@gnoulelem
Copy link
Collaborator

The branch is already pushed : feat/get-user-by-phone-number

@Xazin
Copy link
Member

Xazin commented Oct 18, 2022

The branch is already pushed : feat/get-user-by-phone-number

You can open a PR and we can take a look at it and see if it needs more work or if we can merge it

@gnoulelem
Copy link
Collaborator

I opened the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants