Home > Mobile >  How should I edit rules for Firebase database security?
How should I edit rules for Firebase database security?

Time:12-07

I'm new to React Native. I made an application with words in two languages. All of the words are in the firebase realtime database. Everyday the security warning coming from Firebase. There is no login with a user name and password in the application and I do not want to log in to the application this way. I added anonymous authentication to the app to fix the security issue. I edited the Firebase security rules as follows. But still the same security message comes up. How can I solve this problem?

{
  "rules": {
    ".read": "auth.uid != null",
    ".write": false
  }
}
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

CodePudding user response:

You have to use firebase authentication.Then below code will work for you.

{
  "rules": {
    ".read": "auth.uid != null",
    ".write": false
  }
}

Otherwise you can use https://firebase.google.com/docs/remote-config

CodePudding user response:

The culprit is the double quotes i think

{
  "rules": {
    ".read": auth.uid != null,
    ".write": false
  }
}
  • Related