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
{{ message }}
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.
Hello, I want to know if my token has expired, I update my database with all the token information (auth code, token, refresh_token, expires) and I would like to call $token->hasExpired(), but I do not know how to get an AccessToken object ($token) to call the function. I have tried $this->provider->getAccessToken('access_token', ['access_token'=>$string]) but I tried it more out of desperation than anything.
The text was updated successfully, but these errors were encountered:
I would recommend directly checking that expires value from the database against the current time to see if its expired.
It's not possible to reconstruct the AccessToken object with simply the token string.
However if you have all of the necessary fields from AccessToken stored in your database, you can use its constructor to create a new instance with those values: https://github.com/thephpleague/oauth2-client/blob/master/src/Token/AccessToken.php#L59
You'll need to pass in that $options array with access_token, refresh_token, expires_in, etc.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, I want to know if my token has expired, I update my database with all the token information (auth code, token, refresh_token, expires) and I would like to call $token->hasExpired(), but I do not know how to get an AccessToken object ($token) to call the function. I have tried $this->provider->getAccessToken('access_token', ['access_token'=>$string]) but I tried it more out of desperation than anything.
The text was updated successfully, but these errors were encountered: