nhorvath / Pyrebase4

A simple python wrapper for the Firebase API. ⛺
254 stars 63 forks source link

stream(), Passing "request" in stream_handler() function #6

Open trongtri35 opened 4 years ago

trongtri35 commented 4 years ago

Make sure these boxes are checked before submitting your issue:

[x] Check that your version of Python is 3.4+ (my ver 3.7) [x] Check that you are on the newest version of Pyrebase ( my Pyrebase4) [x] Check that Email/password provider is enabled in your Firebase dashboard under Auth -> Sign In Method. Hi all, i'm using Django and pyrebase with rule of firebase like: "rules": { ".read": "auth != null", ".write": "auth != null", So we need to get idToken when to do something. In my case, i save idToken in session, so i need request argument function to get idToken just like:

def postComment(request):
     idToken = request.session['uid']

But when i use stream(): how can i use request to get idToken in stream_handler function to retrieve data?? Something like:

stream_handler(request, message):
    idToken = request.session['uid']  #Stream_handler get dict first, and i can't use request argument.

Could we edit the pyrebase4 code? How to resolve this? Hope somebody can resolve this. Thank you.

nhorvath commented 4 years ago

I'm unfamiliar with streams. I would need help on this.