INNER CODE UNIT · Python

refresh_auth_cookie

hunvreus/devpush · app/main.py:73

async def refresh_auth_cookie(request: Request, call_next):
    """Sets auth cookie if dependency flagged refresh."""
    response = await call_next(request)
    refresh = getattr(request.state, "auth_cookie_refresh", None)
    if refresh:
        response.set_cookie(
            "auth_token",
            refresh["value"],
            httponly=True,
            samesite="lax",
            secure=(settings.url_scheme == "https"),
            path="/",
            max_age=refresh["max_age"],
        )
    return response


@app.get("/health")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…