Skip to content

Commit c12ca2b

Browse files
Merge pull request #30 from illambo/master
Fix cache expiration condition
2 parents 453d9a7 + 71fd790 commit c12ca2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/OpenIdVerificator.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public function decodeOpenIdToken($openIdToken, $kid, $cache = true)
5050

5151
public function getPublicKey($kid = null)
5252
{
53-
if (Cache::has(self::V3_CERTS)) {
54-
$v3Certs = Cache::get(self::V3_CERTS);
55-
} else {
53+
$v3Certs = Cache::get(self::V3_CERTS);
54+
55+
if (is_null($v3Certs)) {
5656
$v3Certs = $this->getFreshCertificates();
5757
Cache::put(self::V3_CERTS, $v3Certs, Carbon::now()->addSeconds($this->maxAge[self::URL_OPENID_CONFIG]));
5858
}

0 commit comments

Comments
 (0)