[DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider
This commit is contained in:
parent
e4a7fd8eed
commit
0248d4f566
@ -50,7 +50,8 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
*/
|
*/
|
||||||
public function loadTokenBySeries($series)
|
public function loadTokenBySeries($series)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT class, username, value, lastUsed'
|
// the alias for lastUsed works around case insensitivity in PostgreSQL
|
||||||
|
$sql = 'SELECT class, username, value, lastUsed as last_used'
|
||||||
.' FROM rememberme_token WHERE series=:series';
|
.' FROM rememberme_token WHERE series=:series';
|
||||||
$paramValues = array('series' => $series);
|
$paramValues = array('series' => $series);
|
||||||
$paramTypes = array('series' => \PDO::PARAM_STR);
|
$paramTypes = array('series' => \PDO::PARAM_STR);
|
||||||
@ -58,7 +59,7 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if ($row) {
|
if ($row) {
|
||||||
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['lastUsed']));
|
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new TokenNotFoundException('No token found.');
|
throw new TokenNotFoundException('No token found.');
|
||||||
|
Reference in New Issue
Block a user