Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application context #6

Open
araldit opened this issue Jul 26, 2021 · 1 comment
Open

Application context #6

araldit opened this issue Jul 26, 2021 · 1 comment

Comments

@araldit
Copy link

araldit commented Jul 26, 2021

Hi,
I would like to use quart_auth module for login/logout handling. To use this, I need access to the quart application context, but for some reason i cant. Do anyone have an example for getting the current application context, that I can use for storing user login information?

@araldit
Copy link
Author

araldit commented Aug 7, 2021

I have investigated this a little further.
Because everything is websockets, there is no way to exhange cookies during a session - only during the initial handshake, but when the session is startet you can't. When a client has connected, this client will keep its connection open until the browser window closes. You can assign the client with a username and an authenticated flag as a kind of login mechanism and this will work as long as the current websocket connection is ongoing. Every time the client opens a new connection, he will need to be identified again, because there is no cookie control we can use. Another interesting find is, that dash_devices can't run a multipage site, where we control the pages with changing URL's. Instead we should make a single page site, where we change the layouts and widgets with callbacks only.

A way to implement true multi page sites with login can be done by using plain quart with a login screen and cookie handling. If the password or cookie is ok, we spawn the dash_devices site and set the user information in the websocket client session.

Is this rightly understood?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant