Skip to content

Mechanism to write the auth into the user scope automatically or easily #427

@leoschwarz

Description

@leoschwarz

This is a bit hacky way right now but necessary to integrate a marimo app because the user information gets moved into the marimo.app_meta().request object.

class CopyUserMiddleware(BaseHTTPMiddleware):
    async def dispatch(self, request: Request, call_next):
        request.scope["user"] = request.scope["session"]["bfabric_session"]
        response = await call_next(request)
        return response

app.add_middleware(CopyUserMiddleware)

I will need to read up a bit on the API how to best handle this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions