1

What is the best approach for creating a custom auth in firebase so that users can logIn using their userName and password? I have noticed that the most common approach on SO is to actually mask the userName logIn with an email (query on userName) logIn. To me this feels looks like a work-around, and I feel like there should be a better way. So is there a better way, or is everyone just using work-around?

I have no problem taking the email masking approach. I am however concerned that this approach will expose all of users' email addresses. What would be the best data structure for this approach?

My data structure is like this:

{
  "rules": {
    "users": {


  "$uid": {
        ".read": "auth !== null",
        ".write": "auth.uid === $uid",

        "name": {"
      },
        "userName": {
      }
    }
},

"users-Used": {
  ".read": true,
  ".write": "auth !== null"  
}


 }
}
dre_84w934
  • 678
  • 8
  • 27

0 Answers0