mercredi 21 août 2019

Firebase database security for new users

Is there a way to check the values using rules that are initially set on user creation?

I have perused the firebase docs to no avail.

When the function createUserWithEmailAndPassword is called, I then create some values in the database, for example:

    "users": {
        "ht35resf435dwe3rfdw": {
            "is_premium": false,
            "display_name" "John",
            "last_login": 15353723826
        }
    }

The problem I am facing is: is_premium: false is part of the front end code and I am worried that a user could somehow change this to is_premium: true.

I can't figure out a way to check that it is initially set to false on creation.

P.s I could be going about this all wrong, I am a junior so I would appreciate any and all pointers.




Aucun commentaire:

Enregistrer un commentaire