Skip to content Skip to sidebar Skip to footer

Real Time Database Rules For Newsletter Sign Up Form

I have a single field form on my site to sign up for a newsletter. It asks for the email address and submits it to the Firebase database. I do not want anyone to read it apart from

Solution 1:

You'll want to use a $ wildcard rule to reject anything else:

"$uid": {  
  ".write": "!data.exists()",
    "mail" : {
      ".validate": "newData.val().matches(/^.*[@].*[.].*$/)"
    },
    "$other": {
      ".validate": false
    }
}

Post a Comment for "Real Time Database Rules For Newsletter Sign Up Form"