notice when trying to upload to Youtube with Twitter auth

This commit is contained in:
Josh
2017-07-11 15:28:30 -04:00
parent 042622cb01
commit 29ca709c85
4 changed files with 24 additions and 5 deletions

View File

@ -201,10 +201,12 @@ class BbbController < ApplicationController
# POST /rooms/:room_id/recordings/can_upload
def can_upload
# The recording is uploadable if it contains webcam data and they are logged in thorugh Google.
uploadable = Faraday.head(get_webcams_url(params[:rec_id])).status == 200 &&
Rails.application.config.omniauth_google &&
current_user.provider == 'google'
# The recording is uploadable if it contains webcam data and they are logged in through Google.
if current_user.provider != 'google'
uploadable = 'invalid_provider'
else
uploadable = (Faraday.head(get_webcams_url(params[:rec_id])).status == 200 && current_user.provider == 'google').to_s
end
render json: {:uploadable => uploadable}
end