From 4daa2633262218f29508b172eae51693268fa0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Voron?= Date: Mon, 16 Jan 2023 10:20:23 +0100 Subject: [PATCH] Fix typing --- fastapi_users/fastapi_users.py | 6 +++--- fastapi_users/router/oauth.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fastapi_users/fastapi_users.py b/fastapi_users/fastapi_users.py index 2857bb96..c6d3ae37 100644 --- a/fastapi_users/fastapi_users.py +++ b/fastapi_users/fastapi_users.py @@ -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: """ diff --git a/fastapi_users/router/oauth.py b/fastapi_users/router/oauth.py index 081315d8..97bcb6aa 100644 --- a/fastapi_users/router/oauth.py +++ b/fastapi_users/router/oauth.py @@ -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."""