lib/fanswatch/fb_api.rb in fanswatch-0.1.3 vs lib/fanswatch/fb_api.rb in fanswatch-0.1.4
- old
+ new
@@ -10,22 +10,22 @@
FB_TOKEN_URL = URI.join(FB_API_URL, 'oauth/access_token')
def initialize(client_id:, client_secret:)
access_token_response =
HTTP.get(FB_TOKEN_URL,
- params: { client_id: client_id,
- client_secret: client_secret,
+ params: { client_id: ENV['FB_CLIENT_ID'],
+ client_secret: ENV['FB_CLIENT_SECRET'],
grant_type: 'client_credentials' })
@access_token = JSON.load(access_token_response.to_s)['access_token']
end
def self.access_token
return @access_token if @access_token
access_token_response =
HTTP.get(FB_TOKEN_URL,
- params: { client_id: config[:client_id],
- client_secret: config[:client_secret],
+ params: { client_id: ENV['FB_CLIENT_ID'],
+ client_secret: ENV['FB_CLIENT_SECRET'],
grant_type: 'client_credentials' })
@access_token = access_token_response.parse['access_token']
end
def self.config=(credentials)