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 36
36
)
37
37
from .constants import protected_props
38
38
from ...framework import BaseRequest
39
- from supertokens_python .utils import log_debug_message , default_user_context
39
+ from supertokens_python .utils import log_debug_message
40
40
41
41
_T = TypeVar ("_T" )
42
42
@@ -51,8 +51,6 @@ async def attach_to_request_response(
51
51
self .req_res_info = ReqResInfo (request , transfer_method )
52
52
53
53
if self .access_token_updated :
54
- if user_context is None :
55
- user_context = default_user_context (request )
56
54
self .response_mutators .append (
57
55
access_token_mutator (
58
56
self .access_token ,
Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ async def send_email(
430
430
supertokens_config = SupertokensConfig ("http://localhost:3567" ),
431
431
app_info = InputAppInfo (
432
432
app_name = "SuperTokens Demo" ,
433
- api_domain = "http://api.supertokens.io " ,
433
+ api_domain = "localhost:3001 " ,
434
434
origin = get_origin ,
435
435
api_base_path = "/auth" ,
436
436
),
Original file line number Diff line number Diff line change @@ -426,20 +426,23 @@ async def create_new_session(
426
426
)
427
427
428
428
429
+ @mark .asyncio
429
430
async def test_default_user_context_func_calls ():
430
431
# Tests run in the root directory of the repo
431
432
root_dir = Path ("supertokens_python" )
432
433
file_occurences : List [str ] = []
433
434
for path in root_dir .rglob ("*.py" ):
434
435
with open (path ) as f :
436
+ lines = f .readlines ()
435
437
file_occurences .extend (
436
438
[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
439
442
)
440
443
)
441
444
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 )
443
446
)
444
447
445
- assert len (file_occurences ) == 7
448
+ assert len (file_occurences ) == 18
You can’t perform that action at this time.
0 commit comments