X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=extlib%2FAuth%2FOpenID%2FPredisStore.php;fp=extlib%2FAuth%2FOpenID%2FPredisStore.php;h=14ecbbd6f8fc619f0f80d571992b966e90d93655;hb=ed3022adc159fad722d93fe6bdc4a47b9a5d564b;hp=7108c2faf99cf2b0e793365f40ddd565be2ce2fd;hpb=3b6a424c9fd954e64146506c9cd72c14ebd05987;p=quix0rs-gnu-social.git diff --git a/extlib/Auth/OpenID/PredisStore.php b/extlib/Auth/OpenID/PredisStore.php index 7108c2faf9..14ecbbd6f8 100644 --- a/extlib/Auth/OpenID/PredisStore.php +++ b/extlib/Auth/OpenID/PredisStore.php @@ -104,8 +104,11 @@ class Auth_OpenID_PredisStore extends Auth_OpenID_OpenIDStore { // no handle given, receiving the latest issued $serverKey = $this->associationServerKey($server_url); - $lastKey = $this->redis->lpop($serverKey); - if (!$lastKey) { return null; } + $lastKey = $this->redis->lindex($serverKey, -1); + if (!$lastKey) { + // no previous association with this server + return null; + } // get association, return null if failed return $this->getAssociationFromServer($lastKey); @@ -156,10 +159,10 @@ class Auth_OpenID_PredisStore extends Auth_OpenID_OpenIDStore { // SETNX will set the value only of the key doesn't exist yet. $nonceKey = $this->nonceKey($server_url, $salt); - $added = $this->predis->setnx($nonceKey); + $added = $this->redis->setnx($nonceKey, "1"); if ($added) { // Will set expiration - $this->predis->expire($nonceKey, $Auth_OpenID_SKEW); + $this->redis->expire($nonceKey, $Auth_OpenID_SKEW); return true; } else { return false;