mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-08-15 03:04:27 +08:00
Drop Python 3.8 support
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from typing import Generic, Optional, Sequence, Type
|
||||
from collections.abc import Sequence
|
||||
from typing import Generic, Optional
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
@ -20,7 +21,7 @@ try:
|
||||
from fastapi_users.router import get_oauth_router
|
||||
from fastapi_users.router.oauth import get_oauth_associate_router
|
||||
except ModuleNotFoundError: # pragma: no cover
|
||||
BaseOAuth2 = Type # type: ignore
|
||||
BaseOAuth2 = type # type: ignore
|
||||
|
||||
|
||||
class FastAPIUsers(Generic[models.UP, models.ID]):
|
||||
@ -47,7 +48,7 @@ class FastAPIUsers(Generic[models.UP, models.ID]):
|
||||
self.current_user = self.authenticator.current_user
|
||||
|
||||
def get_register_router(
|
||||
self, user_schema: Type[schemas.U], user_create_schema: Type[schemas.UC]
|
||||
self, user_schema: type[schemas.U], user_create_schema: type[schemas.UC]
|
||||
) -> APIRouter:
|
||||
"""
|
||||
Return a router with a register route.
|
||||
@ -59,7 +60,7 @@ class FastAPIUsers(Generic[models.UP, models.ID]):
|
||||
self.get_user_manager, user_schema, user_create_schema
|
||||
)
|
||||
|
||||
def get_verify_router(self, user_schema: Type[schemas.U]) -> APIRouter:
|
||||
def get_verify_router(self, user_schema: type[schemas.U]) -> APIRouter:
|
||||
"""
|
||||
Return a router with e-mail verification routes.
|
||||
|
||||
@ -126,7 +127,7 @@ class FastAPIUsers(Generic[models.UP, models.ID]):
|
||||
def get_oauth_associate_router(
|
||||
self,
|
||||
oauth_client: BaseOAuth2,
|
||||
user_schema: Type[schemas.U],
|
||||
user_schema: type[schemas.U],
|
||||
state_secret: SecretType,
|
||||
redirect_url: Optional[str] = None,
|
||||
requires_verification: bool = False,
|
||||
@ -154,8 +155,8 @@ class FastAPIUsers(Generic[models.UP, models.ID]):
|
||||
|
||||
def get_users_router(
|
||||
self,
|
||||
user_schema: Type[schemas.U],
|
||||
user_update_schema: Type[schemas.UU],
|
||||
user_schema: type[schemas.U],
|
||||
user_update_schema: type[schemas.UU],
|
||||
requires_verification: bool = False,
|
||||
) -> APIRouter:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user