Drop Pydantic v1 support

This commit is contained in:
François Voron
2025-10-25 08:27:54 +02:00
parent fcf9a2041a
commit cd53bb8c5e
10 changed files with 21 additions and 65 deletions

View File

@ -8,7 +8,6 @@ from fastapi_users.authentication.transport.base import (
TransportLogoutNotSupportedError,
)
from fastapi_users.openapi import OpenAPIResponseType
from fastapi_users.schemas import model_dump
class BearerResponse(BaseModel):
@ -24,7 +23,7 @@ class BearerTransport(Transport):
async def get_login_response(self, token: str) -> Response:
bearer_response = BearerResponse(access_token=token, token_type="bearer")
return JSONResponse(model_dump(bearer_response))
return JSONResponse(bearer_response.model_dump())
async def get_logout_response(self) -> Response:
raise TransportLogoutNotSupportedError()