Using a function to check email domain
1
rules_version = '2';
2
service cloud.firestore {
3
match /databases/{database}/documents {
4
match /podcasts/{podcast=**} {
5
function isValidEmail(){
6
return (request.auth.token.email.matches('.*@domain[.]com#x27;) &&
7
request.auth.token.email_verified)
8
}
9
allow write: if isValidEmail();
10
allow read;
11
}
12
}
13
}
Copied!
Last modified 2yr ago
Copy link