Closed GoogleCodeExporter closed 9 years ago
I ran into the same issue... It would be really nice if we could just specify
an optional callback function that is triggered when the token is updated
successfully via apiOAuth2::refreshToken()
For example after this line:
$this->accessToken['created'] = time();
We could have something like:
if (isset($this->refreshTokenCallback))
call_user_func($this->refreshTokenCallback, $this);
Original comment by digitalp...@gmail.com
on 20 Dec 2011 at 11:09
A callback function would be perfect
Original comment by davidcroda
on 20 Dec 2011 at 1:40
On second thought, I would prefer to be able to call the refreshToken method
manually. There is some state related information (ie. what object the access
token belongs to in the database) which would not be available with just the
Auth object.
Original comment by davidcroda
on 20 Dec 2011 at 5:04
Original comment by chirags@google.com
on 3 Jan 2012 at 6:12
Hey David,
Thank you for reporting this!
Changes as of r312.
1) refreshToken is no longer protected inside apiOAuth2 and exposed.
2) You can now access the auth class from apiClient. $client->getAuth();
3) You can also call $client->refreshToken(), which will synchronously refresh
the access token.
Original comment by chirags@google.com
on 6 Jan 2012 at 9:05
Original issue reported on code.google.com by
davidcroda
on 20 Dec 2011 at 4:29