diff options
-rw-r--r-- | apps/oauth2/lib/Db/AccessTokenMapper.php | 10 | ||||
-rw-r--r-- | apps/oauth2/lib/Db/ClientMapper.php | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/apps/oauth2/lib/Db/AccessTokenMapper.php b/apps/oauth2/lib/Db/AccessTokenMapper.php index 0400ad6366c..0b54d5c3da4 100644 --- a/apps/oauth2/lib/Db/AccessTokenMapper.php +++ b/apps/oauth2/lib/Db/AccessTokenMapper.php @@ -42,8 +42,12 @@ class AccessTokenMapper extends Mapper { $qb ->select('*') ->from($this->tableName) - ->where($qb->expr()->eq('hashed_code', $qb->createParameter('hashedCode'))); - - return $this->findEntity($qb->getSQL(), [hash('sha512', $code)]); + ->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code)))); + $result = $qb->execute(); + $rows = $result->fetchAll(); + $result->closeCursor(); + return array_map(function ($row) { + return AccessToken::fromRow($row); + }, $rows); } } diff --git a/apps/oauth2/lib/Db/ClientMapper.php b/apps/oauth2/lib/Db/ClientMapper.php index d3c09ac5c69..8d1f26ce471 100644 --- a/apps/oauth2/lib/Db/ClientMapper.php +++ b/apps/oauth2/lib/Db/ClientMapper.php @@ -42,9 +42,13 @@ class ClientMapper extends Mapper { $qb ->select('*') ->from($this->tableName) - ->where($qb->expr()->eq('client_identifier', $qb->createParameter('clientId'))); - - return $this->findEntity($qb->getSQL(), [$clientIdentifier]); + ->where($qb->expr()->eq('client_identifier', $qb->createNamedParameter($clientIdentifier))); + $result = $qb->execute(); + $rows = $result->fetchAll(); + $result->closeCursor(); + return array_map(function ($row) { + return Client::fromRow($row); + }, $rows); } /** |