1
votes

I already worked through the documentation of Googles FireBase security rules, but I am struggling to get a verification done, where the eMail-address of the FireBase Authtoken is checked if it is part of a domain (like "*@test.de") before reading the FireStore-database is allowed.

I tried:

auth.token.email.matches(/.*@test.de$/)

I copied it from https://firebase.google.com/docs/reference/security/database , but it doesn't seem to work for FireStore.

1
Please edit the question to show the full rule that doesn't work the way you expect, as well as the code on the client that it should allow. - Doug Stevenson

1 Answers

4
votes

This is quite simple if you know the correct syntax.

You can do it like this:

  allow read: if request.auth.token.email.matches('.*@test[.]de');