You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We set the expiration to 100 years, because we can't really access the expiration of the refresh token everywhere we are setting it.
255
+
# This should be safe to do, since this is only the validity of the cookie (set here or on the frontend) but we check the expiration of the JWT anyway.
256
+
# Even if the token is expired the presence of the token indicates that the user could have a valid refresh
257
+
# Setting them to infinity would require special case handling on the frontend and just adding 100 years seems enough.
251
258
response_mutators.append(
252
259
token_response_mutator(
253
260
self.config,
254
261
"access",
255
262
new_access_token_info["token"],
256
-
int(datetime.now().timestamp())+3153600000000,
263
+
get_timestamp_ms()+HUNDRED_YEARS_IN_MS,
257
264
new_session.transfer_method,
258
265
)
259
266
)
@@ -262,7 +269,9 @@ async def create_new_session(
262
269
self.config,
263
270
"refresh",
264
271
new_refresh_token_info["token"],
265
-
new_refresh_token_info["expiry"],
272
+
new_refresh_token_info[
273
+
"expiry"
274
+
], # This comes from the core and is 100 days
266
275
new_session.transfer_method,
267
276
)
268
277
)
@@ -456,12 +465,16 @@ async def get_session(
456
465
session.access_token_payload,
457
466
)
458
467
)
468
+
# We set the expiration to 100 years, because we can't really access the expiration of the refresh token everywhere we are setting it.
469
+
# This should be safe to do, since this is only the validity of the cookie (set here or on the frontend) but we check the expiration of the JWT anyway.
470
+
# Even if the token is expired the presence of the token indicates that the user could have a valid refresh
471
+
# Setting them to infinity would require special case handling on the frontend and just adding 100 years seems enough.
459
472
session.response_mutators.append(
460
473
token_response_mutator(
461
474
self.config,
462
475
"access",
463
476
session.access_token,
464
-
int(datetime.now().timestamp())+3153600000000,
477
+
get_timestamp_ms()+HUNDRED_YEARS_IN_MS,
465
478
session.transfer_method,
466
479
)
467
480
)
@@ -603,12 +616,16 @@ async def refresh_session(
603
616
session.access_token_payload,
604
617
)
605
618
)
619
+
# We set the expiration to 100 years, because we can't really access the expiration of the refresh token everywhere we are setting it.
620
+
# This should be safe to do, since this is only the validity of the cookie (set here or on the frontend) but we check the expiration of the JWT anyway.
621
+
# Even if the token is expired the presence of the token indicates that the user could have a valid refresh
622
+
# Setting them to infinity would require special case handling on the frontend and just adding 100 years seems enough.
606
623
response_mutators.append(
607
624
token_response_mutator(
608
625
self.config,
609
626
"access",
610
627
new_access_token_info["token"],
611
-
int(datetime.now().timestamp())+3153600000000,
628
+
get_timestamp_ms()+HUNDRED_YEARS_IN_MS, # 100 years
# We set the expiration to 100 years, because we can't really access the expiration of the refresh token everywhere we are setting it.
100
+
# This should be safe to do, since this is only the validity of the cookie (set here or on the frontend) but we check the expiration of the JWT anyway.
101
+
# Even if the token is expired the presence of the token indicates that the user could have a valid refresh
102
+
# Setting them to infinity would require special case handling on the frontend and just adding 100 years seems enough.
0 commit comments