@@ -94,8 +94,6 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.jwks</code></h1
9494 # if it has a valid cache entry from one of the core URLs. It will only attempt to fetch
9595 # from the cores again after the entry in the cache is expired
9696 if cached_keys.is_fresh():
97- if environ.get("SUPERTOKENS_ENV") == "testing":
98- log_debug_message("Returning JWKS from cache")
9997 return cached_keys.keys
10098
10199 return None
@@ -125,6 +123,8 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.jwks</code></h1
125123 with RWLockContext(mutex, read=True):
126124 matching_keys = find_matching_keys(get_cached_keys(), kid)
127125 if matching_keys is not None:
126+ if environ.get("SUPERTOKENS_ENV") == "testing":
127+ log_debug_message("Returning JWKS from cache")
128128 return matching_keys
129129 # otherwise unknown kid, will continue to reload the keys
130130
@@ -223,8 +223,6 @@ <h2 class="section-title" id="header-functions">Functions</h2>
223223 # if it has a valid cache entry from one of the core URLs. It will only attempt to fetch
224224 # from the cores again after the entry in the cache is expired
225225 if cached_keys.is_fresh():
226- if environ.get("SUPERTOKENS_ENV") == "testing":
227- log_debug_message("Returning JWKS from cache")
228226 return cached_keys.keys
229227
230228 return None</ code > </ pre >
@@ -248,6 +246,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
248246 with RWLockContext(mutex, read=True):
249247 matching_keys = find_matching_keys(get_cached_keys(), kid)
250248 if matching_keys is not None:
249+ if environ.get("SUPERTOKENS_ENV") == "testing":
250+ log_debug_message("Returning JWKS from cache")
251251 return matching_keys
252252 # otherwise unknown kid, will continue to reload the keys
253253
0 commit comments