Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Security rule to only allow write for users with verified emails

I have very simple write security rule that should only allow users with verified email to write data,

"someNode": {
  ".write": "auth.token.emailVerified === true"
}

For some reason I am still getting permission denied in simulator with specific users token and in my app with same user. I double checked user object in client and it indeed has emailVerified === true hence I am not sure to why this is not working.

Screenshot: enter image description here

like image 749
Ilja Avatar asked Feb 26 '17 15:02

Ilja


1 Answers

Turns out auth.token.emailVerified should be auth.token.email_verified its a bit inconsistent with how such data is presented on client side.

like image 111
Ilja Avatar answered Oct 21 '22 04:10

Ilja