mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2026-03-13 07:49:55 +08:00
Fix typing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Generic, Sequence, Type
|
||||
from typing import Generic, Optional, Sequence, Type
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
@@ -93,7 +93,7 @@ class FastAPIUsers(Generic[models.UP, models.ID]):
|
||||
oauth_client: BaseOAuth2,
|
||||
backend: AuthenticationBackend,
|
||||
state_secret: SecretType,
|
||||
redirect_url: str = None,
|
||||
redirect_url: Optional[str] = None,
|
||||
associate_by_email: bool = False,
|
||||
) -> APIRouter:
|
||||
"""
|
||||
@@ -121,7 +121,7 @@ class FastAPIUsers(Generic[models.UP, models.ID]):
|
||||
oauth_client: BaseOAuth2,
|
||||
user_schema: Type[schemas.U],
|
||||
state_secret: SecretType,
|
||||
redirect_url: str = None,
|
||||
redirect_url: Optional[str] = None,
|
||||
requires_verification: bool = False,
|
||||
) -> APIRouter:
|
||||
"""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Dict, List, Tuple, Type
|
||||
from typing import Dict, List, Optional, Tuple, Type
|
||||
|
||||
import jwt
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, Request, Response, status
|
||||
@@ -32,7 +32,7 @@ def get_oauth_router(
|
||||
backend: AuthenticationBackend,
|
||||
get_user_manager: UserManagerDependency[models.UP, models.ID],
|
||||
state_secret: SecretType,
|
||||
redirect_url: str = None,
|
||||
redirect_url: Optional[str] = None,
|
||||
associate_by_email: bool = False,
|
||||
) -> APIRouter:
|
||||
"""Generate a router with the OAuth routes."""
|
||||
@@ -159,7 +159,7 @@ def get_oauth_associate_router(
|
||||
get_user_manager: UserManagerDependency[models.UP, models.ID],
|
||||
user_schema: Type[schemas.U],
|
||||
state_secret: SecretType,
|
||||
redirect_url: str = None,
|
||||
redirect_url: Optional[str] = None,
|
||||
requires_verification: bool = False,
|
||||
) -> APIRouter:
|
||||
"""Generate a router with the OAuth routes to associate an authenticated user."""
|
||||
|
||||
Reference in New Issue
Block a user