@@ -47,6 +47,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.access_token</c
47
47
from jwt.exceptions import DecodeError
48
48
49
49
from supertokens_python.logger import log_debug_message
50
+ from supertokens_python.recipe.session.utils import SessionConfig
50
51
from supertokens_python.utils import get_timestamp_ms
51
52
52
53
from .exceptions import raise_try_refresh_token_exception
@@ -76,6 +77,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.access_token</c
76
77
77
78
78
79
def get_info_from_access_token(
80
+ config: SessionConfig,
79
81
jwt_info: ParsedJWTInfo,
80
82
do_anti_csrf_check: bool,
81
83
):
@@ -88,7 +90,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.access_token</c
88
90
)
89
91
90
92
if jwt_info.version >= 3:
91
- matching_keys = get_latest_keys(jwt_info.kid)
93
+ matching_keys = get_latest_keys(config, jwt_info.kid)
92
94
payload = jwt.decode( # type: ignore
93
95
jwt_info.raw_token_string,
94
96
matching_keys[0].key, # type: ignore
@@ -98,7 +100,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.access_token</c
98
100
else:
99
101
# It won't have kid. So we'll have to try the token against all the keys from all the jwk_clients
100
102
# If any of them work, we'll use that payload
101
- for k in get_latest_keys():
103
+ for k in get_latest_keys(config ):
102
104
try:
103
105
payload = jwt.decode( # type: ignore
104
106
jwt_info.raw_token_string,
@@ -211,7 +213,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.session.access_token</c
211
213
< h2 class ="section-title " id ="header-functions "> Functions</ h2 >
212
214
< dl >
213
215
< dt id ="supertokens_python.recipe.session.access_token.get_info_from_access_token "> < code class ="name flex ">
214
- < span > def < span class ="ident "> get_info_from_access_token</ span > </ span > (< span > jwt_info: ParsedJWTInfo, do_anti_csrf_check: bool)</ span >
216
+ < span > def < span class ="ident "> get_info_from_access_token</ span > </ span > (< span > config: SessionConfig, jwt_info: ParsedJWTInfo, do_anti_csrf_check: bool)</ span >
215
217
</ code > </ dt >
216
218
< dd >
217
219
< div class ="desc "> </ div >
@@ -220,6 +222,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
220
222
< span > Expand source code</ span >
221
223
</ summary >
222
224
< pre > < code class ="python "> def get_info_from_access_token(
225
+ config: SessionConfig,
223
226
jwt_info: ParsedJWTInfo,
224
227
do_anti_csrf_check: bool,
225
228
):
@@ -232,7 +235,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
232
235
)
233
236
234
237
if jwt_info.version >= 3:
235
- matching_keys = get_latest_keys(jwt_info.kid)
238
+ matching_keys = get_latest_keys(config, jwt_info.kid)
236
239
payload = jwt.decode( # type: ignore
237
240
jwt_info.raw_token_string,
238
241
matching_keys[0].key, # type: ignore
@@ -242,7 +245,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
242
245
else:
243
246
# It won't have kid. So we'll have to try the token against all the keys from all the jwk_clients
244
247
# If any of them work, we'll use that payload
245
- for k in get_latest_keys():
248
+ for k in get_latest_keys(config ):
246
249
try:
247
250
payload = jwt.decode( # type: ignore
248
251
jwt_info.raw_token_string,
@@ -309,7 +312,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
309
312
</ details >
310
313
</ dd >
311
314
< dt id ="supertokens_python.recipe.session.access_token.sanitize_number "> < code class ="name flex ">
312
- < span > def < span class ="ident "> sanitize_number</ span > </ span > (< span > n: Any) ‑> Union[int, float, ForwardRef( None) ]</ span >
315
+ < span > def < span class ="ident "> sanitize_number</ span > </ span > (< span > n: Any) ‑> Union[int, float, None]</ span >
313
316
</ code > </ dt >
314
317
< dd >
315
318
< div class ="desc "> </ div >
0 commit comments