0

I would like to be able to have my database only accessible from 3 Google domains. I can access it from one domain but when I try to add more it fails.

The rules I have tried so far:

{
    "rules": {
        ".read": "auth.token.email.endswith('mycompany@gmail.com')"
    } 
} 

I have tried to add an or statement into it but with the second domain I don't get authorised.

Michal
  • 15,429
  • 10
  • 73
  • 104
Camlt
  • 5
  • 1
  • 4

1 Answers1

0

Try playing with this syntax instead:

"auth.token.email.matches(/.*@gmail.com$/)"

You can put logical operators inside as well - &&, ||.


More here and obviously here.

Michal
  • 15,429
  • 10
  • 73
  • 104