Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/test-server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import os
import traceback
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, TypeVar, Union

import override_logging
from accountlinking import add_accountlinking_routes # pylint: disable=import-error
Expand Down Expand Up @@ -55,6 +55,7 @@
from supertokens_python.recipe.session import InputErrorHandlers, SessionContainer
from supertokens_python.recipe.session.framework.flask import verify_session
from supertokens_python.recipe.session.recipe import SessionRecipe
from supertokens_python.recipe.session.utils import TokenTransferMethod
from supertokens_python.recipe.thirdparty.provider import UserFields, UserInfoMap
from supertokens_python.recipe.thirdparty.recipe import ThirdPartyRecipe
from supertokens_python.recipe.totp.recipe import TOTPRecipe
Expand Down Expand Up @@ -298,6 +299,13 @@ async def custom_unauthorised_callback(
)
return response

def get_token_transfer_method(
_: BaseRequest,
__: bool,
___: Dict[str, Any],
) -> Union[TokenTransferMethod, Literal["any"]]:
return recipe_config_json.get("getTokenTransferMethod", "any")

recipe_config_json = json.loads(recipe_config.get("config", "{}"))
recipe_list.append(
session.init(
Expand All @@ -318,6 +326,7 @@ async def custom_unauthorised_callback(
use_dynamic_access_token_signing_key=recipe_config_json.get(
"useDynamicAccessTokenSigningKey"
),
get_token_transfer_method=get_token_transfer_method,
override=session.InputOverrideConfig(
apis=override_builder_with_logging(
"Session.override.apis",
Expand Down
Loading