forked from External/greenlight
Updated rubocop and fixed issues (#490)
This commit is contained in:
committed by
Jesus Federico
parent
bc57caa806
commit
a0c99dde47
@ -84,8 +84,8 @@ module ApplicationHelper
|
||||
begin
|
||||
provider_info = retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials')
|
||||
provider_info['provider'] == 'greenlight'
|
||||
rescue => ex
|
||||
logger.info ex
|
||||
rescue => e
|
||||
logger.info e
|
||||
false
|
||||
end
|
||||
end
|
||||
|
@ -31,7 +31,7 @@ module RecordingsHelper
|
||||
len = valid_playbacks.first[:length]
|
||||
if len > 60
|
||||
"#{(len / 60).to_i} hrs #{len % 60} mins"
|
||||
elsif len == 0
|
||||
elsif len.zero?
|
||||
"< 1 min"
|
||||
else
|
||||
"#{len} min"
|
||||
|
@ -60,22 +60,20 @@ module SessionsHelper
|
||||
|
||||
def generate_checksum(user_domain, redirect_url, secret)
|
||||
string = user_domain + redirect_url + secret
|
||||
OpenSSL::Digest.digest('sha1', string).unpack("H*").first
|
||||
OpenSSL::Digest.digest('sha1', string).unpack1("H*")
|
||||
end
|
||||
|
||||
def parse_user_domain(hostname)
|
||||
return hostname.split('.').first if Rails.configuration.url_host.empty?
|
||||
Rails.configuration.url_host.split(',').each do |url_host|
|
||||
if hostname.include?(url_host)
|
||||
return hostname.chomp(url_host).chomp('.')
|
||||
end
|
||||
return hostname.chomp(url_host).chomp('.') if hostname.include?(url_host)
|
||||
end
|
||||
''
|
||||
end
|
||||
|
||||
def omniauth_options(env)
|
||||
gl_redirect_url = (Rails.env.production? ? "https" : env["rack.url_scheme"]) + "://" + env["SERVER_NAME"] + ":" +
|
||||
env["SERVER_PORT"]
|
||||
env["SERVER_PORT"]
|
||||
user_domain = parse_user_domain(env["SERVER_NAME"])
|
||||
env['omniauth.strategy'].options[:customer] = user_domain
|
||||
env['omniauth.strategy'].options[:gl_redirect_url] = gl_redirect_url
|
||||
|
Reference in New Issue
Block a user