Commit 9562aff4 authored by Stan Hu's avatar Stan Hu

Fix access token not loading in sync

parent 68fd81a0
......@@ -58,12 +58,12 @@ class ZoomClient
bytes_written
end
private
def access_token
JWT.encode({ iss: api_key, exp: Time.now.to_i + 86400 }, api_secret, 'HS256', { typ: 'JWT' })
end
private
def request_headers
{
'Accept' => 'application/json',
......@@ -214,7 +214,6 @@ class ZoomSyncher
end
def sync_recording(item)
unless item['topic'].match(REC_REGEX)
puts "Skipping '#{item['topic']}' as it doesn't include [REC]"
return
......@@ -244,7 +243,7 @@ class ZoomSyncher
ext = file_extension(file_type)
folder = subfolder(topic, file_type)
filename = sanitize_filename("#{topic}-#{event_date}-#{uuid}-#{index}") + ".#{ext}"
video_url = file['download_url'] + "?access_token=#{access_token}"
video_url = file['download_url'] + "?access_token=#{client.access_token}"
file_size = file['file_size']
if file_size.to_i > MAX_FILE_SIZE_BYTES
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment