Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61dc765

Browse files
committed
Use UserBadge in all passports
1 parent c25e7dd commit 61dc765

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

security/experimental_authenticators.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,15 +494,15 @@ The following credential classes are supported by default:
494494
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
495495

496496
// ...
497-
return new Passport($user, new PasswordCredentials($plaintextPassword));
497+
return new Passport(new UserBadge($email), new PasswordCredentials($plaintextPassword));
498498

499499
:class:`Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Credentials\\CustomCredentials`
500500
Allows a custom closure to check credentials::
501501

502502
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\CustomCredentials;
503503

504504
// ...
505-
return new Passport($user, new CustomCredentials(
505+
return new Passport(new UserBadge($email), new CustomCredentials(
506506
// If this function returns anything else than `true`, the credentials
507507
// are marked as invalid.
508508
// The $credentials parameter is equal to the next argument of this class
@@ -581,7 +581,7 @@ would initialize the passport like this::
581581
// ... validate no parameter is empty
582582

583583
return new Passport(
584-
new UserBadge($user),
584+
new UserBadge($email),
585585
new PasswordCredentials($password),
586586
[new CsrfTokenBadge('login', $csrfToken)]
587587
);

0 commit comments

Comments
 (0)