Improved

FastAPI Session Type Safety

📣 FastAPI Auth SDK 1.1.0 Release 🎉

Please refer to the GitHub README for updated documentation and details.


Session Access and Type Safety Improvements

Enhanced session management with better type safety and dual access patterns:

Key Changes

  • Added get_session() dependency function: Provides typed Session access without performing auth/CSRF validation, useful for router-level protected routes or non-protected access
  • Session Protocol as public interface: Promoted Session Protocol to public API for type-safe session access with IDE autocomplete. Support for extending Session Protocol with custom typed fields.
  • Dual session access patterns: Sessions now accessible via both request.state.session (untyped) and typed Session dependency injection via Depends(get_session) or Depends(require_session_auth)
  • README updated throughout to reflect all changes
  • The FastAPI Demo App has been updated to to use these SDK changes.