Module: FacebookService

Defined in:
app/services/facebook_service.rb

Class Method Summary collapse

Class Method Details

.app_access_tokenObject


3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/services/facebook_service.rb', line 3

def app_access_token
  return '' if Rails.env.test?
  return @app_access_token if @app_access_token
  @app_access_token = HTTParty.get(
    <<-EOF.squish.delete(' ')
      https://graph.facebook.com//oauth/access_token?
        client_id=#{ENV['FB_APP_ID']}&
        client_secret=#{ENV['FB_APP_SECRET']}&
        grant_type=client_credentials
      EOF
  ).gsub(/.+=/, '')
end