File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
supertokens_python/recipe/session Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 3636)
3737from .constants import protected_props
3838from ...framework import BaseRequest
39- from supertokens_python .utils import log_debug_message , default_user_context
39+ from supertokens_python .utils import log_debug_message
4040
4141_T = TypeVar ("_T" )
4242
@@ -51,8 +51,6 @@ async def attach_to_request_response(
5151 self .req_res_info = ReqResInfo (request , transfer_method )
5252
5353 if self .access_token_updated :
54- if user_context is None :
55- user_context = default_user_context (request )
5654 self .response_mutators .append (
5755 access_token_mutator (
5856 self .access_token ,
Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ async def send_email(
430430 supertokens_config = SupertokensConfig ("http://localhost:3567" ),
431431 app_info = InputAppInfo (
432432 app_name = "SuperTokens Demo" ,
433- api_domain = "http://api.supertokens.io " ,
433+ api_domain = "localhost:3001 " ,
434434 origin = get_origin ,
435435 api_base_path = "/auth" ,
436436 ),
Original file line number Diff line number Diff line change @@ -426,20 +426,23 @@ async def create_new_session(
426426 )
427427
428428
429+ @mark .asyncio
429430async def test_default_user_context_func_calls ():
430431 # Tests run in the root directory of the repo
431432 root_dir = Path ("supertokens_python" )
432433 file_occurences : List [str ] = []
433434 for path in root_dir .rglob ("*.py" ):
434435 with open (path ) as f :
436+ lines = f .readlines ()
435437 file_occurences .extend (
436438 [str (path )]
437- * f .read ().count (
438- "user_context = set_request_in_user_context_if_not_defined("
439+ * sum (
440+ "set_request_in_user_context_if_not_defined(" in line
441+ for line in lines
439442 )
440443 )
441444 file_occurences .extend (
442- [str (path )] * f . read (). count ( "user_context = default_user_context(" )
445+ [str (path )] * sum ( " default_user_context(" in line for line in lines )
443446 )
444447
445- assert len (file_occurences ) == 7
448+ assert len (file_occurences ) == 18
You can’t perform that action at this time.
0 commit comments