Moh'd Awad
Moh'd Awad

Reputation: 1768

Firebase Database auth variable does not work

The Doc says

Once a user authenticates, the auth variable in your Firebase Database Rules rules will be populated with the user's information. This information includes their unique identifier (uid) as well as linked account data, such as a Facebook id or an email address, and other info.

and i made and Auth in my app with google but when try reading the database it's return

Firebase Database error: Permission denied

where this is my rules :

{
  "rules": {
    "msgs":{
    ".read": "auth != null && auth.provider == 'google'",
    ".write":"auth != null && auth.provider == 'google'"
    }
  }
}

Upvotes: 0

Views: 735

Answers (1)

Jason Stewart
Jason Stewart

Reputation: 123

Try auth !== null it seems to want there to be two equal signs.

Upvotes: 2

Related Questions