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

login / logout functions #204

Open
Archmonger opened this issue Jan 5, 2024 · 1 comment
Open

login / logout functions #204

Archmonger opened this issue Jan 5, 2024 · 1 comment

Comments

@Archmonger
Copy link
Contributor

Archmonger commented Jan 5, 2024

Current Situation

The login function supplied by Django Channels provides non-persistent access to the Django session due to technical limitations.

The reason is that WebSockets are unable to modify HTTP cookies. Unfortunately, HTTP cookies are required to persist Django login state changes.

Proposed Actions

This might need to be implemented as a use_auth hook.

On a technical level, the following will need to be developed:

  • Server Side: Create a HTTP login view that accepts a UUID. This UUID will be attached to a session, which valid for 60 seconds (configurable). Somehow will need to refresh the scope['session'] after a successful authentication.
  • Client Side: Perform the login/logout via client JavaScript using the upcoming use_messenger hook. Will likely be an AJAX HTTP POST request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant