Get uid by email

前端 未结 1 649
执念已碎
执念已碎 2021-01-27 21:28

I\'m using firebase authentication on the web, I have a database similar to this:

categories: {
    c1: {
        name: \"Category 1,
    },
    c2: {
        na         


        
相关标签:
1条回答
  • 2021-01-27 21:54

    There is a way to look up the user account by its email address, but only in the Firebase Admin SDK. This SDK is meant for use in trusted environments, i.e. a system that you control, or Cloud Functions. If that is what you're looking for, read more about it in retrieving user data.

    If you're looking to run this on the client, then indeed there is no way to look up the user's UID by their email address. In that case, the common approach is indeed to create a mapping in the database. Be sure to secure access to this data though, as otherwise you risk leaking all email addresses for your users.

    0 讨论(0)
提交回复
热议问题