allow selecting conference option

This commit is contained in:
Bilal
2020-08-19 13:05:16 +03:00
parent 27fade2d09
commit f5628c47df
12 changed files with 89 additions and 31 deletions

View File

@@ -17,11 +17,21 @@ class MicrosoftGraph
end
def create_teams_meeting(subject)
if @refresh_token.nil? || @token_expires_at.nil?
raise ActionController::InvalidAuthenticityToken, 'Missing refresh token / token expiration'
return
end
# Obtain new token if token is expired or will expire in less than 5 minutes
if 5.minutes.from_now.to_i > @token_expires_at.seconds
refresh_access_token
end
if @token.nil?
raise ActionController::InvalidAuthenticityToken, 'Missing access token'
return
end
response = HTTParty.post(
"#{BASE_URL}/me/onlineMeetings",
body: {