diff --git a/systers_portal/meetup/utils.py b/systers_portal/meetup/utils.py index 0c930471..65d243ac 100644 --- a/systers_portal/meetup/utils.py +++ b/systers_portal/meetup/utils.py @@ -18,6 +18,11 @@ from systers_portal.settings.base import ZOOM_API_KEY,\ ZOOM_API_SECRET, ZOOM_USER_ID +payload = { + 'exp': datetime.datetime.utcnow() + datetime.timedelta(seconds=30), + 'iss': ZOOM_API_KEY + } +token = jwt.encode(payload, ZOOM_API_SECRET).decode("utf-8") @transaction.atomic def create_groups(meetup): @@ -122,11 +127,7 @@ def notify_time(meetup): def create_meetup(meetup): conn = http.client.HTTPSConnection("api.zoom.us") - payload = { - 'exp': datetime.datetime.utcnow() + datetime.timedelta(seconds=30), - 'iss': ZOOM_API_KEY - } - token = jwt.encode(payload, ZOOM_API_SECRET).decode("utf-8") + headers = { 'authorization': "Bearer " + token, @@ -155,11 +156,7 @@ def create_meetup(meetup): def edit_meetup(meetup): conn = http.client.HTTPSConnection("api.zoom.us") - payload = { - 'exp': datetime.datetime.utcnow() + datetime.timedelta(seconds=30), - 'iss': ZOOM_API_KEY - } - token = jwt.encode(payload, ZOOM_API_SECRET).decode("utf-8") + headers = { 'authorization': "Bearer " + token, @@ -183,11 +180,7 @@ def edit_meetup(meetup): def get_meetup(meetup): conn = http.client.HTTPSConnection("api.zoom.us") - payload = { - 'exp': datetime.datetime.utcnow() + datetime.timedelta(seconds=30), - 'iss': ZOOM_API_KEY - } - token = jwt.encode(payload, ZOOM_API_SECRET).decode("utf-8") + headers = { 'authorization': "Bearer " + token,