Module: DeviseOauth2CanvasFacebook::FacebookConsumerHelper

Included in:
Devise::FacebookConsumerController
Defined in:
lib/devise_oauth2_canvas_facebook/facebook_consumer_helper.rb

Instance Method Summary collapse

Instance Method Details

#facebook_client(token = nil) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/devise_oauth2_canvas_facebook/facebook_consumer_helper.rb', line 3

def facebook_client(token = nil)
  if token.present?
    FBGraph::Client.new(:client_id => Devise.facebook_api_key, :secret_id => Devise.facebook_api_secret)
  else
    FBGraph::Client.new(:client_id => Devise.facebook_api_key, :secret_id => Devise.facebook_api_secret, :token => token)
  end
end