Skip to content

Get "Required option not passed: "access_token"" message, when try to exchange token second time. #94

@BooleanType

Description

@BooleanType

I test $oauth->getAccessToken() method in this section: https://github.com/basvandorst/StravaPHP#usage-1
When I call it first time with some token, everything is OK, I retrieve the following response:

image

But when I call it second time, I get an InvalidArgumentException:

image

I understand why this happens - there is no "access_token" in response, 'cause response looks like that:

image

But at first it was not obvious to me. Is it possible to handle this? I mean, is it possible to throw another exception, more clear, about exactly invalid authorization code; some exception, that clearly tells us, that we can't use same auth code twice? Then it would be easier to handle this more specific exception.

Thanks.

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