Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 17397d5

Browse files
pasdeloupfabpot
authored andcommitted
[Security] [Guard] Improve comment with working example
1 parent 0441ef2 commit 17397d5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Guard/GuardAuthenticatorInterface.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@ interface GuardAuthenticatorInterface extends AuthenticationEntryPointInterface
3939
* Whatever value you return here will be passed to getUser() and checkCredentials()
4040
*
4141
* For example, for a form login, you might:
42-
*
43-
* return array(
44-
* 'username' => $request->request->get('_username'),
45-
* 'password' => $request->request->get('_password'),
46-
* );
42+
*
43+
* if ($request->request->has('_username')) {
44+
* return array(
45+
* 'username' => $request->request->get('_username'),
46+
* 'password' => $request->request->get('_password'),
47+
* );
48+
* } else {
49+
* return;
50+
* }
4751
*
4852
* Or for an API token that's on a header, you might use:
4953
*

0 commit comments

Comments
 (0)