FromDK / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

Patch for /trunk/examples/latitude/index.php #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Only start to make API requests if a token exists.  If no token exists then the 
only thing we should be doing is creating the authorization URL and printing 
the Connect Me! link.

Otherwise, an error will be thrown when it tries to refresh a token that 
doesn't exist.

Original issue reported on code.google.com by krkee...@gmail.com on 17 Aug 2011 at 11:12

Attachments:

GoogleCodeExporter commented 8 years ago
The API calls will be executed if there's something inside 
$client->getAccessToken()).

The API call is guarded by the following if statement:
if ($client->getAccessToken()) {
 ... make an API request ...
}

Can you run a var_dump on $client->getAccessToken() in the case where no token 
exists?

Original comment by chirags@google.com on 31 Aug 2011 at 4:52