Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit 096a79a

Browse files
committed
Fix: Change expiration of the underlying token
* Make expiration the same as the cookie expiration
1 parent 8a8a780 commit 096a79a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

models/db.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ def _validateUser(username, password, fname, lname, email, course_name, line):
624624

625625
def create_rs_token():
626626
d = dict(sub=auth.user.username)
627-
expires = datetime.timedelta(days=30)
627+
expires = datetime.timedelta(days=105)
628628
_create_access_token(d, expires=expires)
629629

630630

@@ -652,8 +652,8 @@ def _create_access_token(data: dict, expires=None, scopes=None) -> bytes:
652652
if expires:
653653
expires_in = datetime.datetime.utcnow() + expires
654654
else:
655-
# default to 15 minutes expiry times
656-
expires_in = datetime.datetime.utcnow() + datetime.timedelta(minutes=15)
655+
# default to 105 days expiry times about a semester
656+
expires_in = datetime.datetime.utcnow() + datetime.timedelta(days=105)
657657

658658
to_encode.update({"exp": expires_in})
659659

0 commit comments

Comments
 (0)