Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #30 from basz/fix/jti-read-write
Browse files Browse the repository at this point in the history
actually read and save jti
  • Loading branch information
TomHAnderson committed May 22, 2015
2 parents 8deebf1 + dc35760 commit 342e30f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Adapter/DoctrineAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,13 @@ public function getJti(
$query = $mapper->getDoctrineArrayCopy();

$jti= $this->getObjectManager()->getRepository($config['mapping']['ZF\OAuth2\Doctrine\Mapper\Jti']['entity'])
->findOneBy($query);
->findOneBy(array(
$doctrineClientIdField => $query['client'],
$doctrineSubjectField => $query['subject'],
$doctrineAudienceField => $query['audience'],
$doctrineExpirationField => $query['expires'],
$doctrineJtiField => $query['jti'],
));

if (!$jti) {
return false;
Expand All @@ -1280,13 +1286,13 @@ public function getJti(
* @param $audience
* The audience to insert.
*
* @param $expiration
* @param $expires
* The expiration of the jti.
*
* @param $jti
* The jti to insert.
*/
public function setJti($client_id, $subject, $audience, $expiration, $jti)
public function setJti($client_id, $subject, $audience, $expires, $jti)
{
$config = $this->getConfig();
$jtiEntity = new $config['mapping']['ZF\OAuth2\Doctrine\Mapper\Jti']['entity'];
Expand All @@ -1296,7 +1302,7 @@ public function setJti($client_id, $subject, $audience, $expiration, $jti)
'client_id' => $client_id,
'subject' => $subject,
'audience' => $audience,
'expiration' => $expiration,
'expires' => $expires,
'jti' => $jti,
));

Expand Down

0 comments on commit 342e30f

Please sign in to comment.