From b36fc32ea8a7de12888cff09948ecf6d221747a8 Mon Sep 17 00:00:00 2001 From: Jean Pasdeloup Date: Wed, 22 Jun 2016 14:10:03 +0200 Subject: [PATCH] [Security] [Guard] Improve comment with working example --- .../Security/Guard/GuardAuthenticatorInterface.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Security/Guard/GuardAuthenticatorInterface.php b/src/Symfony/Component/Security/Guard/GuardAuthenticatorInterface.php index 947594cecf..b28f06d337 100644 --- a/src/Symfony/Component/Security/Guard/GuardAuthenticatorInterface.php +++ b/src/Symfony/Component/Security/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: *