File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
supertokens_python/recipe/session Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -274,9 +274,9 @@ async def create_new_session_in_request(
274274 or is_an_ip_address (app_info .top_level_api_domain )
275275 )
276276 and (
277- app_info .top_level_website_domain (request , user_context ) == "localhost"
277+ app_info .get_top_level_website_domain (request , user_context ) == "localhost"
278278 or is_an_ip_address (
279- app_info .top_level_website_domain (request , user_context )
279+ app_info .get_top_level_website_domain (request , user_context )
280280 )
281281 )
282282 )
@@ -404,10 +404,14 @@ async def refresh_session_in_request(
404404 disable_anti_csrf = request_transfer_method == "header"
405405 anti_csrf_token = get_anti_csrf_header (request )
406406
407+ anti_csrf = config .anti_csrf_function_or_string
408+ if callable (anti_csrf ):
409+ anti_csrf = anti_csrf (request , user_context )
410+
407411 if (
408- config . anti_csrf_function_or_string == "VIA_CUSTOM_HEADER"
412+ anti_csrf == "VIA_CUSTOM_HEADER"
409413 and not disable_anti_csrf
410- ): # TODO: can be function
414+ ):
411415 if get_rid_from_header (request ) is None :
412416 log_debug_message (
413417 "refreshSession: Returning UNAUTHORISED because anti-csrf token is undefined"
You can’t perform that action at this time.
0 commit comments