summaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-11-11 09:25:42 +0100
committerRobin Appelman <robin@icewind.nl>2016-11-16 15:24:31 +0100
commite5bc80b31dee6b08fc42d35a4930e23685f167eb (patch)
tree902ee3d1a798573bd51322330e42da52add5b78b /lib/private/Authentication
parent91851c37be39e0d45e7edd4f770e0254d1ae75fa (diff)
downloadnextcloud-server-e5bc80b31dee6b08fc42d35a4930e23685f167eb.tar.gz
nextcloud-server-e5bc80b31dee6b08fc42d35a4930e23685f167eb.zip
Adds TokenProvider and Mapper tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Authentication')
-rw-r--r--lib/private/Authentication/Token/DefaultTokenMapper.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/private/Authentication/Token/DefaultTokenMapper.php b/lib/private/Authentication/Token/DefaultTokenMapper.php
index 32551a9b37c..8848cd3ec56 100644
--- a/lib/private/Authentication/Token/DefaultTokenMapper.php
+++ b/lib/private/Authentication/Token/DefaultTokenMapper.php
@@ -74,8 +74,7 @@ class DefaultTokenMapper extends Mapper {
$qb = $this->db->getQueryBuilder();
$result = $qb->select('id', 'uid', 'login_name', 'password', 'name', 'type', 'remember', 'token', 'last_activity', 'last_check', 'scope')
->from('authtoken')
- ->where($qb->expr()->eq('token', $qb->createParameter('token')))
- ->setParameter('token', $token)
+ ->where($qb->expr()->eq('token', $qb->createNamedParameter($token)))
->execute();
$data = $result->fetch();
@@ -88,19 +87,18 @@ class DefaultTokenMapper extends Mapper {
}
/**
- * Get the user UID for the given token
+ * Get the token for $id
*
- * @param string $token
+ * @param string $id
* @throws DoesNotExistException
* @return DefaultToken
*/
- public function getTokenById($token) {
+ public function getTokenById($id) {
/* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder();
$result = $qb->select('id', 'uid', 'login_name', 'password', 'name', 'type', 'token', 'last_activity', 'last_check', 'scope')
->from('authtoken')
- ->where($qb->expr()->eq('id', $qb->createParameter('id')))
- ->setParameter('id', $token)
+ ->where($qb->expr()->eq('id', $qb->createNamedParameter($id)))
->execute();
$data = $result->fetch();