From f575893f181bd3ebaf36e6a9d75b85ca0a027578 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 30 Dec 2024 16:27:46 +0530 Subject: [PATCH] fix: cyclic import --- examples/with-flask/with-thirdpartyemailpassword/app.py | 5 ++++- supertokens_python/recipe/oauth2provider/api/end_session.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/with-flask/with-thirdpartyemailpassword/app.py b/examples/with-flask/with-thirdpartyemailpassword/app.py index 4d5794cb..93cad962 100644 --- a/examples/with-flask/with-thirdpartyemailpassword/app.py +++ b/examples/with-flask/with-thirdpartyemailpassword/app.py @@ -15,8 +15,10 @@ dashboard, emailverification, session, + usermetadata, thirdparty, ) +from supertokens_python.recipe.session import SessionContainer from supertokens_python.recipe.session.framework.flask import verify_session load_dotenv() @@ -46,6 +48,7 @@ def get_website_domain(): session.init(), dashboard.init(), emailverification.init("REQUIRED"), + usermetadata.init(), thirdparty.init( sign_in_and_up_feature=thirdparty.SignInAndUpFeature( providers=[ @@ -156,7 +159,7 @@ def get_website_domain(): @app.route("/sessioninfo", methods=["GET"]) # type: ignore @verify_session() def get_session_info(): - session_: session.SessionContainer = g.supertokens + session_: SessionContainer = g.supertokens return jsonify( { "sessionHandle": session_.get_handle(), diff --git a/supertokens_python/recipe/oauth2provider/api/end_session.py b/supertokens_python/recipe/oauth2provider/api/end_session.py index de5b9330..a1a876cb 100644 --- a/supertokens_python/recipe/oauth2provider/api/end_session.py +++ b/supertokens_python/recipe/oauth2provider/api/end_session.py @@ -30,7 +30,6 @@ 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]], @@ -84,6 +83,7 @@ async def end_session_common( ) -> Optional[BaseResponse]: from ..interfaces import RedirectResponse, ErrorOAuth2Response from supertokens_python.recipe.session.asyncio import get_session + from supertokens_python.recipe.session.exceptions import TryRefreshTokenError if api_implementation is None: return None