We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5244296 commit 8e3fa05Copy full SHA for 8e3fa05
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