Skip to content

Commit

Permalink
#29 Set a course payload JWT expire (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Pushyami Gundala <pushyamig@users.noreply.github.com>
  • Loading branch information
mlhess and pushyamig authored Jul 26, 2024
1 parent 8fd2819 commit baa6be1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lti_redirect/maizey.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from datetime import datetime, timedelta, timezone
import jwt, logging
from decouple import config
from jwt.exceptions import InvalidKeyError
Expand All @@ -14,9 +15,10 @@ def __init__(self, lti_launch_data) -> None:
def get_restructured_data(self):
course_title = self.lti_launch_data['https://purl.imsglobal.org/spec/lti/claim/context']['title']
lis = self.lti_launch_data['https://purl.imsglobal.org/spec/lti/claim/lis']

expiration_time = datetime.now(timezone.utc) + timedelta(seconds=300)
# Restructure the course info for Maizey needs
restructured_data = {
"exp" : expiration_time,
"canvas_url": self.lti_custom_data["canvas_url"],
"course": {
"id": self.lti_custom_data["course_id"],
Expand Down

0 comments on commit baa6be1

Please sign in to comment.