Skip to content

Commit

Permalink
Update guard-authentication.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanginneken committed Dec 16, 2015
1 parent 168072b commit a46a856
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cookbook/security/guard-authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ This requires you to implement six methods::

public function getUser($credentials, UserProviderInterface $userProvider)
{
$apiToken = $credentials['token'];
$apiKey = $credentials['token'];

// if null, authentication will fail
// if a User object, checkCredentials() is called
return $this->em->getRepository('AppBundle:User')
->findOneBy(array('apiToken' => $apiToken));
->findOneBy(array('apiKey' => $apiKey));
}

public function checkCredentials($credentials, UserInterface $user)
Expand Down

0 comments on commit a46a856

Please sign in to comment.