diff options
author | Jean Pasdeloup <jpasdeloup@sedona.fr> | 2016-06-22 14:10:03 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2016-06-23 09:37:24 +0200 |
commit | 17397d5c43a3572f68fa3fc2ea72fb3a14e88368 (patch) | |
tree | 35233fe47f449989386942a9dab86c90d9fb2498 /Guard/GuardAuthenticatorInterface.php | |
parent | 0441ef2d18b4de4570f6364c70d0af7dd0d447f1 (diff) | |
download | symfony-security-17397d5c43a3572f68fa3fc2ea72fb3a14e88368.zip symfony-security-17397d5c43a3572f68fa3fc2ea72fb3a14e88368.tar.gz symfony-security-17397d5c43a3572f68fa3fc2ea72fb3a14e88368.tar.bz2 |
[Security] [Guard] Improve comment with working example
Diffstat (limited to 'Guard/GuardAuthenticatorInterface.php')
-rw-r--r-- | Guard/GuardAuthenticatorInterface.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Guard/GuardAuthenticatorInterface.php b/Guard/GuardAuthenticatorInterface.php index 947594c..b28f06d 100644 --- a/Guard/GuardAuthenticatorInterface.php +++ b/Guard/GuardAuthenticatorInterface.php @@ -39,11 +39,15 @@ interface GuardAuthenticatorInterface extends AuthenticationEntryPointInterface * Whatever value you return here will be passed to getUser() and checkCredentials() * * For example, for a form login, you might: - * - * return array( - * 'username' => $request->request->get('_username'), - * 'password' => $request->request->get('_password'), - * ); + * + * if ($request->request->has('_username')) { + * return array( + * 'username' => $request->request->get('_username'), + * 'password' => $request->request->get('_password'), + * ); + * } else { + * return; + * } * * Or for an API token that's on a header, you might use: * |