From 61dc76568fe769311e98b76df8682b190df34e41 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Wed, 17 Mar 2021 10:18:54 +0100 Subject: [PATCH] Use UserBadge in all passports --- security/experimental_authenticators.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/experimental_authenticators.rst b/security/experimental_authenticators.rst index eb0ffa098e0..269aefe01a0 100644 --- a/security/experimental_authenticators.rst +++ b/security/experimental_authenticators.rst @@ -494,7 +494,7 @@ The following credential classes are supported by default: use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials; // ... - return new Passport($user, new PasswordCredentials($plaintextPassword)); + return new Passport(new UserBadge($email), new PasswordCredentials($plaintextPassword)); :class:`Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Credentials\\CustomCredentials` Allows a custom closure to check credentials:: @@ -502,7 +502,7 @@ The following credential classes are supported by default: use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\CustomCredentials; // ... - return new Passport($user, new CustomCredentials( + return new Passport(new UserBadge($email), new CustomCredentials( // If this function returns anything else than `true`, the credentials // are marked as invalid. // The $credentials parameter is equal to the next argument of this class @@ -581,7 +581,7 @@ would initialize the passport like this:: // ... validate no parameter is empty return new Passport( - new UserBadge($user), + new UserBadge($email), new PasswordCredentials($password), [new CsrfTokenBadge('login', $csrfToken)] );