arsduo / koala

A lightweight Facebook library supporting the Graph, Marketing, and Atlas APIs, realtime updates, test users, and OAuth.

Home Page:http://developers.facebook.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use default app access token in API

ArmandoAssuncao opened this issue · comments

Hi,

I was trying to use the default app_access_token in the Koala::Facebook::API and saw that it is not possible.

Then I looked at the code:

args["access_token"] ||= @access_token || @app_access_token if @access_token || @app_access_token

I saw that args["access_token"] is only assigned by the @access_token. The @app_access_token will never be assigned because it does not start.

So I think it should look like this:

args["access_token"] ||= Koala.config.access_token || Koala.config.app_access_token if @access_token || Koala.config.app_access_token

Thus, if @access_token is not defined at initialize(), it will use Koala.config.access_token or Koala.config.app_access_token.

What do you think?