Firestore Security Rules Regex

528 views
Skip to first unread message

Romeo Bahoumda

unread,
Jul 20, 2018, 9:51:48 PM7/20/18
to Firebase Google Group
I have trouble modifying my Regex expression to satisfy the rules semantics
I want it to check if the email matches a particular domain
so it looks like this

request.auth.token.email.matches(/^[A-Z0-9._%+-]+@(lehigh)+\\.(edu)$/i)

What should I change?

Matthew Evans

unread,
Aug 11, 2018, 3:40:23 AM8/11/18
to Firebase Google Group
Im assuming you just want to allow all email addresses from the lehigh.edu domain?
should look like this:
request.auth.token.email.matches('/.*@lehigh[.]edu/') == true;
Reply all
Reply to author
Forward
0 new messages