lib/omniauth/strategies/fellowshipone.rb
def consumer
        # update site with the real URL based on the church name received via
        # the request parms
        client_options = options.client_options.merge(:site => options.site.sub(/%CC/, request.params['church_code']))
        consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, client_options)
        consumer.options[:church_code] = request.params['church_code']
        consumer.http.open_timeout = options.open_timeout if options.open_timeout
        consumer.http.read_timeout = options.read_timeout if options.read_timeout
        consumer
      end
# Override consumer construction so we can grab the church_code from the
# request parameters to fully construct the URL for the site, replacing
# %CC.  We also save the church code in the consumer so we can make it
# part of the access token later.
#
# Adapted from OmniAuth::Strategies::OAuth::consumer
Override consumer construction so we can grab the church_code from the
request parameters to fully construct the URL for the site, replacing
%CC.  We also save the church code in the consumer so we can make it
part of the access token later.


Override consumer construction so we can grab the church_code from the request parameters to fully construct the URL for the site replacing %CC . We also save the church code in the consumer so we can make it part of the access token later .
def consumer
        client_options = options.client_options.merge(:site => options.site.sub(/%CC/, request.params['church_code']))
        consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, client_options)
        consumer.options[:church_code] = request.params['church_code']
        consumer.http.open_timeout = options.open_timeout if options.open_timeout
        consumer.http.read_timeout = options.read_timeout if options.read_timeout
        consumer
      end
def consumer client_options = options . client_options . merge ( :site => options . site . sub ( / %CC / , request . params [ 'church_code' ] ) ) consumer = :: OAuth :: Consumer . new ( options . consumer_key , options . consumer_secret , client_options ) consumer . options [ :church_code ] = request . params [ 'church_code' ] consumer . http . open_timeout = options . open_timeout if options . open_timeout consumer . http . read_timeout = options . read_timeout if options . read_timeout consumer end
Override consumer construction so we can grab the church_code from the
request parameters to fully construct the URL for the site, replacing
%CC.
Override consumer construction so we can grab the church_code from the request parameters to fully construct the URL for the site replacing %CC .
# update site with the real URL based on the church name received via # the request parms