firebase rules throwing permission denied errors
For some reason, the supplied security rules keep throwing permission denied errors whenever i try to push data to fb. I ended up using this as a stopgap:
{
"rules": {
".read": true,
".write": "auth != null"
}
}
It's not perfect, but it's simple & at minimum, you need to have a token. I tried all of the following:
".write": "auth != null && (!data.exists() || !newData.exists())"
".write": "auth != null && !data.exists()"
".write": "auth != null && !newData.exists()"
but they each throw the same error in my browser console:
FIREBASE WARNING: set at /users/twitter:1643903942 failed: permission_denied firebase.js:35
Did you figure this out?
Nope. Still using the above hack
I assume you meant:
".write": "auth != null && newData.exists()"
if you're pushing data, obviously new data must exist. The other ones would only work if the db was empty
Change the rules to ".read": true, ".write": true
worked for me.