Skip to content

Commit

Permalink
minor #6027 Update guard-authentication.rst (rvanginneken)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.8 branch.

Discussion
----------

Update guard-authentication.rst

Commits
-------

a46a856 Update guard-authentication.rst
  • Loading branch information
xabbuh committed Dec 17, 2015
2 parents e23f2d4 + a46a856 commit de11d3e
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 de11d3e

Please sign in to comment.