We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5244296 + 8e3fa05 commit 680f83bCopy full SHA for 680f83b
1 file changed
src/Bookboon/ApiBundle/Service/ApiFactory.php
@@ -44,7 +44,9 @@ public static function credentialFactory(Bookboon $bookboon, Cache $cache, Confi
44
45
if ($token === false) {
46
$token = $bookboon->getClient()->requestAccessToken([], OauthGrants::CLIENT_CREDENTIALS);
47
- $cache->save("bookboonapi.{$config->getId()}", $token);
+
48
+ $ttl = $token->getExpires() - time();
49
+ $cache->save("bookboonapi.{$config->getId()}", $token, $ttl);
50
}
51
52
return $token;
0 commit comments