File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
includes/Core/Authentication/Clients Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -264,17 +264,15 @@ private function setup_client() {
264264
265265 // This is called when the client refreshes the access token on-the-fly.
266266 $ client ->setTokenCallback (
267- function ( $ cache_key , $ access_token ) {
267+ function ( $ cache_key , $ access_token ) use ( $ client ) {
268268 $ expires_in = HOUR_IN_SECONDS ; // Sane default, Google OAuth tokens are typically valid for an hour.
269269 $ created = 0 ; // This will be replaced with the current timestamp when saving.
270270
271271 // Try looking up the real values if possible.
272- if ( isset ( $ client ) ) {
273- $ token = $ client ->getAccessToken ();
274- if ( isset ( $ token ['access_token ' ], $ token ['expires_in ' ], $ token ['created ' ] ) && $ access_token === $ token ['access_token ' ] ) {
275- $ expires_in = $ token ['expires_in ' ];
276- $ created = $ token ['created ' ];
277- }
272+ $ token = $ client ->getAccessToken ();
273+ if ( isset ( $ token ['access_token ' ], $ token ['expires_in ' ], $ token ['created ' ] ) && $ access_token === $ token ['access_token ' ] ) {
274+ $ expires_in = $ token ['expires_in ' ];
275+ $ created = $ token ['created ' ];
278276 }
279277
280278 $ this ->set_access_token ( $ access_token , $ expires_in , $ created );
You can’t perform that action at this time.
0 commit comments