Skip to content

Commit

Permalink
Merge pull request #30 from illambo/master
Browse files Browse the repository at this point in the history
Fix cache expiration condition
  • Loading branch information
marickvantuil authored Aug 21, 2021
2 parents 453d9a7 + 71fd790 commit c12ca2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OpenIdVerificator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function decodeOpenIdToken($openIdToken, $kid, $cache = true)

public function getPublicKey($kid = null)
{
if (Cache::has(self::V3_CERTS)) {
$v3Certs = Cache::get(self::V3_CERTS);
} else {
$v3Certs = Cache::get(self::V3_CERTS);

if (is_null($v3Certs)) {
$v3Certs = $this->getFreshCertificates();
Cache::put(self::V3_CERTS, $v3Certs, Carbon::now()->addSeconds($this->maxAge[self::URL_OPENID_CONFIG]));
}
Expand Down

0 comments on commit c12ca2b

Please sign in to comment.