module DHS::OAuth

Private Instance Methods

dhs_check_auto_oauth_enabled!() click to toggle source
# File lib/dhs/concerns/o_auth.rb, line 20
def dhs_check_auto_oauth_enabled!
  return if DHS.config.auto_oauth.present? && DHS.config.auto_oauth.is_a?(Proc)
  raise 'You have to enable DHS.config.auto_oauth by passing a proc returning an access token!'
end
dhs_store_oauth_access_token() click to toggle source
# File lib/dhs/concerns/o_auth.rb, line 15
def dhs_store_oauth_access_token
  dhs_check_auto_oauth_enabled!
  DHS::Interceptors::AutoOauth::ThreadRegistry.access_token = instance_exec(&DHS.config.auto_oauth)
end