0

I have recently started with pyrebase and I am having trouble in storing data depending on user and receiving it. After completing the authentication part I create a user ID as user['idToken'] And then pushed data by using

archer = {"name": "Sterling Archer", "agency": "Figgis Agency"} 
db.child("agents").push(archer, user['idToken'])

I assume that each user has different ID token which remains same even if we logout and relogin. but when I am using

all_agents = db.child("agents").get(user['idToken']).val()
print(all_agentes)

It's printing all data stored in realtime database. Even which were stored by other users.

I tried reading all it's documentation, but I was unable to understand how to handle it.

What's wrong that I am doing in here and How can I correct it?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Malay Agrawal
  • 27
  • 1
  • 12

1 Answers1

0

Use user[localId] instead of user[idToken] as it will create database for every different user separately

Malay Agrawal
  • 27
  • 1
  • 12