Skip to content

login / logout functions #204

@Archmonger

Description

@Archmonger

Current Situation

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

To summarize the problem: ReactPy runs off of WebsSockets. Browsers do not allow active WebSocket connections to modify HTTP cookies. Django's authentication design requires HTTP cookies to persist Django login.

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions