StravaPHP icon indicating copy to clipboard operation
StravaPHP copied to clipboard

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

Open BooleanType opened this issue 1 year ago • 0 comments

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.

BooleanType avatar Nov 14 '23 08:11 BooleanType