Skip to content

Authentication/Session Integration #769

@Archmonger

Description

@Archmonger

Current Situation

It is currently fairly awkward to use ReactPy for authentication for some of our supported backends.

Reference

Proposed Actions

Have some sort of session integration to improve authentication usability within ReactPy.

We will need to decide how this API will look like after analyzing our backend's built-in authentication APIs. Not all backends contain authentication features though, so designing around this might get tricky.

It could possibly look like this:

from reactpy import component
from reactpy.backend.sanic import configure, create_session

use_session, session_store = create_session(
    save=save_to_my_db,
    load=load_from_my_db,
)

@component
def MyComponent():
    session = use_session()
    ...

app = Sanic()
configure(app, MyComponent, Options(session_store=session_store)
app.run()

Also, It might be reasonable for ReactPy to create it's own sqlite DB for things such as session keys on frameworks without native ORM capabilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-2-moderateShould be resolved on a reasonable timeline.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions