I have a database and got an email that my rules are not secure. this is what i have now:
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
i wanted to change it to something like in the example in the site, so a user can read\write only to his record, but this doesn't work. i get denied.
what am i doing wrong?
how do i know if my key is $uid or $user_id?
the database structure is like:
root
--uid
-- all the data
Rules:
{
"rules": {
"$uid": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid"
}
}
}
sample of my data:

