Improve type hints (#1401)

* Add type parameters to `AuthenticationBackend`

* add more type-hints
This commit is contained in:
Alexander Zinov
2024-07-14 17:04:13 +04:00
committed by GitHub
parent 6ac64ad293
commit abfa9a1c47
8 changed files with 25 additions and 25 deletions

View File

@ -3,7 +3,7 @@ import uuid
from typing import Optional
from fastapi import Depends, Request
from fastapi_users import BaseUserManager, FastAPIUsers, UUIDIDMixin
from fastapi_users import BaseUserManager, FastAPIUsers, UUIDIDMixin, models
from fastapi_users.authentication import (
AuthenticationBackend,
BearerTransport,
@ -47,7 +47,7 @@ async def get_user_manager(user_db: SQLAlchemyUserDatabase = Depends(get_user_db
bearer_transport = BearerTransport(tokenUrl="auth/jwt/login")
def get_jwt_strategy() -> JWTStrategy:
def get_jwt_strategy() -> JWTStrategy[models.UP, models.ID]:
return JWTStrategy(secret=SECRET, lifetime_seconds=3600)