diff --git a/dev-requirements.txt b/dev-requirements.txt index 83a80a4a..1d6dd270 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -9,7 +9,7 @@ flask-cors==5.0.0 nest-asyncio==1.6.0 pdoc3==0.11.0 pylint==3.2.7 -pyright==1.1.389 +pyright==1.1.391 python-dotenv==1.0.1 pytest==8.3.3 pytest-asyncio==0.24.0 diff --git a/supertokens_python/recipe/oauth2provider/api/auth.py b/supertokens_python/recipe/oauth2provider/api/auth.py index 57850ec0..96baad46 100644 --- a/supertokens_python/recipe/oauth2provider/api/auth.py +++ b/supertokens_python/recipe/oauth2provider/api/auth.py @@ -19,8 +19,6 @@ from urllib.parse import parse_qsl from dateutil import parser -from supertokens_python.recipe.session.asyncio import get_session -from supertokens_python.recipe.session.exceptions import TryRefreshTokenError from supertokens_python.utils import send_200_response, send_non_200_response if TYPE_CHECKING: @@ -40,6 +38,8 @@ async def auth_get( RedirectResponse, ErrorOAuth2Response, ) + from supertokens_python.recipe.session.asyncio import get_session + from supertokens_python.recipe.session.exceptions import TryRefreshTokenError if api_implementation.disable_auth_get is True: return None diff --git a/supertokens_python/recipe/oauth2provider/api/end_session.py b/supertokens_python/recipe/oauth2provider/api/end_session.py index 531b13e6..de5b9330 100644 --- a/supertokens_python/recipe/oauth2provider/api/end_session.py +++ b/supertokens_python/recipe/oauth2provider/api/end_session.py @@ -19,8 +19,6 @@ from supertokens_python.exceptions import raise_bad_input_exception from supertokens_python.framework import BaseResponse -from supertokens_python.recipe.session import SessionContainer -from supertokens_python.recipe.session.exceptions import TryRefreshTokenError from supertokens_python.types import GeneralErrorResponse from supertokens_python.utils import send_200_response, send_non_200_response @@ -31,6 +29,8 @@ RedirectResponse, ErrorOAuth2Response, ) + from supertokens_python.recipe.session import SessionContainer + from supertokens_python.recipe.session.exceptions import TryRefreshTokenError EndSessionCallable = Callable[ [Dict[str, str], APIOptions, Optional[SessionContainer], bool, Dict[str, Any]], diff --git a/supertokens_python/recipe/oauth2provider/api/login.py b/supertokens_python/recipe/oauth2provider/api/login.py index f3c9cdeb..56353782 100644 --- a/supertokens_python/recipe/oauth2provider/api/login.py +++ b/supertokens_python/recipe/oauth2provider/api/login.py @@ -20,7 +20,6 @@ from supertokens_python.exceptions import raise_bad_input_exception from supertokens_python.framework import BaseResponse -from supertokens_python.recipe.session.exceptions import TryRefreshTokenError from supertokens_python.utils import send_200_response, send_non_200_response from http.cookies import SimpleCookie @@ -42,6 +41,7 @@ async def login( ErrorOAuth2Response, ) from supertokens_python.recipe.session.asyncio import get_session + from supertokens_python.recipe.session.exceptions import TryRefreshTokenError if api_implementation.disable_login_get is True: return None diff --git a/supertokens_python/recipe/oauth2provider/api/user_info.py b/supertokens_python/recipe/oauth2provider/api/user_info.py index ec236b68..20efde67 100644 --- a/supertokens_python/recipe/oauth2provider/api/user_info.py +++ b/supertokens_python/recipe/oauth2provider/api/user_info.py @@ -16,7 +16,6 @@ from typing import TYPE_CHECKING, Any, Dict, Optional -from supertokens_python.asyncio import get_user from supertokens_python.utils import ( send_200_response, send_non_200_response_with_message, @@ -35,6 +34,8 @@ async def user_info_get( api_options: APIOptions, user_context: Dict[str, Any], ): + from supertokens_python.asyncio import get_user + if api_implementation.disable_user_info_get is True: return None diff --git a/supertokens_python/recipe/oauth2provider/api/utils.py b/supertokens_python/recipe/oauth2provider/api/utils.py index 166ae2f3..46471527 100644 --- a/supertokens_python/recipe/oauth2provider/api/utils.py +++ b/supertokens_python/recipe/oauth2provider/api/utils.py @@ -21,7 +21,6 @@ from supertokens_python import Supertokens from supertokens_python.recipe.multitenancy.constants import DEFAULT_TENANT_ID -from supertokens_python.recipe.session.asyncio import get_session_information from ..constants import LOGIN_PATH, AUTH_PATH, END_SESSION_PATH if TYPE_CHECKING: @@ -48,6 +47,7 @@ async def login_get( FrontendRedirectionURLTypeTryRefresh, FrontendRedirectionURLTypeLogin, ) + from supertokens_python.recipe.session.asyncio import get_session_information login_request = await recipe_implementation.get_login_request( challenge=login_challenge,