Firebase Rules not working

67 views
Skip to first unread message

Kim Mosher

unread,
Mar 6, 2019, 10:21:12 AM3/6/19
to Firebase Google Group
I have a firebase firestore. In it is a database called Shoals. In that are user documents. They each have a field called email. Each of these documents has several collections, that relate to locations they have been. Here's the problem. When I set me firestore rules as such: 

  service cloud.firestore {
      match /databases/{database}/documents {
          match /shoals/{name} {
               allow read:if resource.data.email == request.auth.token.email;
           }
      }
  }

I use my email, I login, and it fails. Any ideas?
By the way, I want to use email because it is part of my authentication process and I do not want to expose the uid in my javascript app.

Kato Richardson

unread,
Mar 6, 2019, 12:20:27 PM3/6/19
to Firebase Google Group
Hi Kim,

What does the code fetching the data look like? How specifically does it fail?

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/07d0d083-920b-4a85-9a75-05062e9dfa53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages