Skip to content

access_token as option overriden by client_id #11

@chrisbenseler

Description

@chrisbenseler

The official doc from Untappd says the API can receive either client_id and secret or a users's access_token (example: https://untappd.com/api/docs#beerinfo).
When you set client_id and client_secret in the configure block, those parameters are always sent, even if you pass in the option the "access_token" parameter.
Code example:

options = Hash.new
options["access_token"] = "something here"
...
Untappd::Beer.info(beer.bid, options)

The thing is, that when client_id is sent, the Untappd API ignores the access_token, and the request belongs to the app (using the relation from the app and the client_id). I noticed it because my application reached too quickly the rate limit form Untappd API (100 requests/hour), and the requests should be related to each of the users who have connected to my app in Untappd.

I think that there should be a way that the gem checks if the options has a "access_token"; if so, the client_id and client_secret is not sent.
Does it make any sense to you?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions