0

I need to get the user ID when I input the mail of the user.

Is it possible?

Of course I have an authenticated user who is asking for the mail of a user already created.

I want to retrieve users like

var refer = firebase.auth ().ref ('[email protected]') refer.on ('value', function (snapshot) { console.log (snapshot.val()); }) 

But in a possible way.

3
  • firebase.auth ().ref ('[email protected]') I don't think that is the auth service has a ref() method: firebase.google.com/docs/reference/js/firebase.auth.Auth. Commented Oct 17, 2016 at 18:26
  • Aside from that: there is no API to look up the uid of a user based on their email address in Firebsae Authentication. If you need that functionality, you'll need to store the mapping yourself ; for example in the Firebase Database. Commented Oct 17, 2016 at 18:30
  • Yep, I finally did exactly that. Thanks for your time. Commented Oct 17, 2016 at 19:57

1 Answer 1

1

Store the user info you want on a separate node in your database structure, then when the user asks for that, you retrieve from that endpoint.

See these:

Sign up to request clarification or add additional context in comments.

1 Comment

I just edited the question, I don't think you understood right.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.