Skip to content

fix: changelog and fastapi middleware #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.18.11] - 2024-04-26

- Fixes session issues with django-rest-framework.
- Fixes issues with the propagation of session creation/updates with django-rest-framework because the django-rest-framework wrapped the original request with it's own request object. Updates on that object were not reflecting on the original request object.
- Fixes type mismatch for FastAPI middleware.

## [0.18.10] - 2024-04-05

Expand Down
5 changes: 1 addition & 4 deletions supertokens_python/framework/fastapi/fastapi_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@
from supertokens_python.framework import BaseResponse

if TYPE_CHECKING:
from fastapi import FastAPI, Request
from fastapi import Request


def get_middleware():
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from supertokens_python.utils import default_user_context

class Middleware(BaseHTTPMiddleware):
def __init__(self, app: FastAPI):
super().__init__(app)

async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):
from supertokens_python import Supertokens
from supertokens_python.exceptions import SuperTokensError
Expand Down