koala
koala copied to clipboard
Use default app access token in API
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: https://github.com/arsduo/koala/blob/3c7037eea67062f05eccb16836bebec403ddbfec/lib/koala/api.rb#L95
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?