Closed Hellisotherpeople closed 2 weeks ago
Hi @Hellisotherpeople ! You can pass gr.Request
to your function. Please see the docs here: https://www.gradio.app/docs/gradio/request#request-header .
Gonna close for now.
@freddyaboulton I'm aware of the existence of gr.Request, but I do not know how to use it in the context of the exact code that I've linked here.
Beyond that, I am extremely frustrated when I am linked to documentation with almost no other assistance on my question. I have seen this documentation that you have linked but it's not good enough alone, and I am still stuck
Please show me a specific example of using gr.Request in the context of the code I specified to get access to the request.session object.
Please reopen this issue or show me a real code example in the context of the code I linked.
BTW, I'm pretty desperate to get a proper, working solution for this. I'm willing to pay 200USD for a working solution.
I tried to get folks on the discord to help, but no one there is helpful.
How does one access a fastapi request object within gradio itself?
Let's say I do auth like this:
How do I access the request.session object from within a Gr.blocks demo? like this
I ask this question as I am implementing an app based on the gradio google oauth example, but the example doesn't show how to handle multiple users being simultaneously logged in while not overwriting their auth tokens - this causes data leakage, and means that (at least with my code) if a new user logs into google oauth when someone else is using the app, than the new users token is leaked to all other users.