step-up-labs / firebase-database-dotnet

C# library for Firebase Realtime Database.
MIT License
668 stars 168 forks source link

Rules #282

Closed allecsxxx closed 2 years ago

allecsxxx commented 2 years ago

Using the rules below:

{ "rules": {
"$uid": { ".write": "$uid === auth.uid", ".read": "true" }
} } In realtime database I have :

UXub2KF5Jrekt2anvOnrxvamQFm2 |__ Status: 3 where child name is the auth uid of the logged in user.

In visual studio :

var forAuth = await authService.getUid(); await firebase .Child(forAuth) .PatchAsync(new Users1() { Status = 1 }); return true; Using the rule $uid===auth.uid I get exception 401 , using "true" instead all works fine !

Is there something I don t understand or something I miss ?