You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I first access it, I click Connect and click Authorize.
I'm redirected to http://localhost/strava/api-001.php and can see my athlete info.
However, if I click F5 on the browser, I end up with this error:
PHP Fatal error: Uncaught InvalidArgumentException: Required option not passed: "access_token" in C:\Data\Websites\vendor\league\oauth2-client\src\Token\AccessToken.php:96
Stack trace:
#0 C:\Data\Websites\vendor\league\oauth2-client\src\Provider\AbstractProvider.php(844): League\OAuth2\Client\Token\AccessToken->__construct(Array)
#1 C:\Data\Websites\vendor\league\oauth2-client\src\Provider\AbstractProvider.php(642): League\OAuth2\Client\Provider\AbstractProvider->createAccessToken(Array, Object(League\OAuth2\Client\Grant\AuthorizationCode))
#2 C:\Data\Websites\strava\api-001.php(33): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken(Object(League\OAuth2\Client\Grant\AuthorizationCode), Array)
#3 {main}
thrown in C:\Data\Websites\vendor\league\oauth2-client\src\Token\AccessToken.php on line 96
I realise the documentation on the main page for this repository has 2 sections:
First, authorisation and authentication
Then, call your API method!
I tried putting the code for the second part in a separate page, but then it errors on this line:
$service = new REST($token->getToken(), $adapter); // Define your user token here.
Because I haven't defined $token which is why in my quoted code above I redirect to the same starting page api-001.php as that already has $token defined.
I thought maybe I can store $token in localStorage but I am not sure how I'd store $token in localStorage as it is an array I think, not just a variable with a single value.
Sorry for probably overlooking something very basic - but I cannot see how to set things up so that I can refresh the page, otherwise I have to go back to click Connect each time.
Hi - firstly, thank you for making this repository.
I have a simple page below -
api-001.php
:When I first access it, I click
Connect
and clickAuthorize
.I'm redirected to
http://localhost/strava/api-001.php
and can see my athlete info.However, if I click F5 on the browser, I end up with this error:
I realise the documentation on the main page for this repository has 2 sections:
First, authorisation and authentication
Then, call your API method!
I tried putting the code for the second part in a separate page, but then it errors on this line:
Because I haven't defined
$token
which is why in my quoted code above I redirect to the same starting pageapi-001.php
as that already has$token
defined.I thought maybe I can store
$token
in localStorage but I am not sure how I'd store$token
in localStorage as it is an array I think, not just a variable with a single value.Sorry for probably overlooking something very basic - but I cannot see how to set things up so that I can refresh the page, otherwise I have to go back to click
Connect
each time.I checked these issues:
#92
#57
But can't work it out.
Sorry if it is something simple, I have basic PHP skills but am trying to work out what to do.
Thanks
The text was updated successfully, but these errors were encountered: