Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed58c69

Browse filesBrowse files
committed
[Security] Remove getPassword() and getSalt() from UserInterface
1 parent 06c9d62 commit ed58c69
Copy full SHA for ed58c69

File tree

17 files changed

+59
-105
lines changed
Filter options

17 files changed

+59
-105
lines changed

‎src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,16 @@ public function supportsClass(string $class)
133133
*
134134
* @final
135135
*/
136-
public function upgradePassword(UserInterface $user, string $newEncodedPassword): void
136+
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
137137
{
138-
if (!$user instanceof PasswordAuthenticatedUserInterface) {
139-
trigger_deprecation('symfony/doctrine-bridge', '5.3', 'The "%s::upgradePassword()" method expects an instance of "%s" as first argument, the "%s" class should implement it.', PasswordUpgraderInterface::class, PasswordAuthenticatedUserInterface::class, get_debug_type($user));
140-
}
141-
142138
$class = $this->getClass();
143139
if (!$user instanceof $class) {
144140
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_debug_type($user)));
145141
}
146142

147143
$repository = $this->getRepository();
148144
if ($repository instanceof PasswordUpgraderInterface) {
149-
$repository->upgradePassword($user, $newEncodedPassword);
145+
$repository->upgradePassword($user, $newHashedPassword);
150146
}
151147
}
152148

‎src/Symfony/Bridge/Doctrine/Tests/Fixtures/User.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Fixtures/User.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ public function getPassword(): ?string
4444
{
4545
}
4646

47-
public function getSalt(): ?string
48-
{
49-
}
50-
5147
public function getUsername(): string
5248
{
5349
return $this->name;

‎src/Symfony/Component/Ldap/Security/LdapUserProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Security/LdapUserProvider.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Security\Core\Exception\InvalidArgumentException;
1919
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
2020
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
21+
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
2122
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
2223
use Symfony\Component\Security\Core\User\UserInterface;
2324
use Symfony\Component\Security\Core\User\UserProviderInterface;
@@ -132,7 +133,7 @@ public function refreshUser(UserInterface $user)
132133
*
133134
* @final
134135
*/
135-
public function upgradePassword(UserInterface $user, string $newEncodedPassword): void
136+
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
136137
{
137138
if (!$user instanceof LdapUser) {
138139
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_debug_type($user)));
@@ -143,9 +144,9 @@ public function upgradePassword(UserInterface $user, string $newEncodedPassword)
143144
}
144145

145146
try {
146-
$user->getEntry()->setAttribute($this->passwordAttribute, [$newEncodedPassword]);
147+
$user->getEntry()->setAttribute($this->passwordAttribute, [$newHashedPassword]);
147148
$this->ldap->getEntryManager()->update($user->getEntry());
148-
$user->setPassword($newEncodedPassword);
149+
$user->setPassword($newHashedPassword);
149150
} catch (ExceptionInterface $e) {
150151
// ignore failed password upgrades
151152
}

‎src/Symfony/Component/PasswordHasher/Hasher/UserPasswordHasher.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PasswordHasher/Hasher/UserPasswordHasher.php
+2-12Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,20 @@ public function __construct(PasswordHasherFactoryInterface $hasherFactory)
3232

3333
public function hashPassword(PasswordAuthenticatedUserInterface $user, string $plainPassword): string
3434
{
35-
$salt = null;
36-
if ($user instanceof LegacyPasswordAuthenticatedUserInterface) {
37-
$salt = $user->getSalt();
38-
}
39-
4035
$hasher = $this->hasherFactory->getPasswordHasher($user);
4136

42-
return $hasher->hash($plainPassword, $salt);
37+
return $hasher->hash($plainPassword, $user instanceof LegacyPasswordAuthenticatedUserInterface ? $user->getSalt() : null);
4338
}
4439

4540
public function isPasswordValid(PasswordAuthenticatedUserInterface $user, string $plainPassword): bool
4641
{
47-
$salt = null;
48-
if ($user instanceof LegacyPasswordAuthenticatedUserInterface) {
49-
$salt = $user->getSalt();
50-
}
51-
5242
if (null === $user->getPassword()) {
5343
return false;
5444
}
5545

5646
$hasher = $this->hasherFactory->getPasswordHasher($user);
5747

58-
return $hasher->verify($user->getPassword(), $plainPassword, $salt);
48+
return $hasher->verify($user->getPassword(), $plainPassword, $user instanceof LegacyPasswordAuthenticatedUserInterface ? $user->getSalt() : null);
5949
}
6050

6151
public function needsRehash(PasswordAuthenticatedUserInterface $user): bool

‎src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php
+6-9Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ public function __construct(UserProviderInterface $userProvider, UserCheckerInte
5151
*/
5252
protected function checkAuthentication(UserInterface $user, UsernamePasswordToken $token)
5353
{
54+
if ($user instanceof PasswordAuthenticatedUserInterface) {
55+
throw new \LogicException(sprintf('Class "%s" must implement "%s" for using password-based authentication.',get_debug_type($user), PasswordAuthenticatedUserInterface::class));
56+
}
57+
5458
$currentUser = $token->getUser();
59+
5560
if ($currentUser instanceof UserInterface) {
5661
if ($currentUser->getPassword() !== $user->getPassword()) {
5762
throw new BadCredentialsException('The credentials were changed from another session.');
@@ -65,15 +70,7 @@ protected function checkAuthentication(UserInterface $user, UsernamePasswordToke
6570
throw new BadCredentialsException('The presented password is invalid.');
6671
}
6772

68-
if (!$user instanceof PasswordAuthenticatedUserInterface) {
69-
trigger_deprecation('symfony/security-core', '5.3', 'Using password-based authentication listeners while not implementing "%s" interface from class "%s" is deprecated.', PasswordAuthenticatedUserInterface::class, get_debug_type($user));
70-
}
71-
72-
$salt = $user->getSalt();
73-
if ($salt && !$user instanceof LegacyPasswordAuthenticatedUserInterface) {
74-
trigger_deprecation('symfony/security-core', '5.3', 'Returning a string from "getSalt()" without implementing the "%s" interface is deprecated, the "%s" class should implement it.', LegacyPasswordAuthenticatedUserInterface::class, get_debug_type($user));
75-
}
76-
73+
$salt = $user instanceof LegacyPasswordAuthenticatedUserInterface ? $user->getSalt() : null;
7774
$hasher = $this->hasherFactory->getPasswordHasher($user);
7875

7976
if (!$hasher->verify($user->getPassword(), $presentedPassword, $salt)) {

‎src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php
+10-7Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

1414
use Symfony\Component\Security\Core\User\EquatableInterface;
15+
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
1516
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
1617
use Symfony\Component\Security\Core\User\UserInterface;
1718

@@ -273,14 +274,16 @@ private function hasUserChanged(UserInterface $user): bool
273274
return !(bool) $this->user->isEqualTo($user);
274275
}
275276

276-
// @deprecated since Symfony 5.3, check for PasswordAuthenticatedUserInterface on both user objects before comparing passwords
277-
if ($this->user->getPassword() !== $user->getPassword()) {
278-
return true;
279-
}
277+
if ($this->user instanceof PasswordAuthenticatedUserInterface || $user instanceof PasswordAuthenticatedUserInterface) {
278+
if (!$this->user instanceof PasswordAuthenticatedUserInterface || !$user instanceof PasswordAuthenticatedUserInterface || $this->user->getPassword() !== $user->getPassword()) {
279+
return true;
280+
}
280281

281-
// @deprecated since Symfony 5.3, check for LegacyPasswordAuthenticatedUserInterface on both user objects before comparing salts
282-
if ($this->user->getSalt() !== $user->getSalt()) {
283-
return true;
282+
if ($this->user instanceof LegacyPasswordAuthenticatedUserInterface || $user instanceof LegacyPasswordAuthenticatedUserInterface) {
283+
if (!$this->user instanceof LegacyPasswordAuthenticatedUserInterface || !$user instanceof LegacyPasswordAuthenticatedUserInterface || $this->user->getSalt() !== $user->getSalt()) {
284+
return true;
285+
}
286+
}
284287
}
285288

286289
$userRoles = array_map('strval', (array) $user->getRoles());

‎src/Symfony/Component/Security/Core/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/CHANGELOG.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ CHANGELOG
55
---
66

77
* `TokenInterface` does not extend `Serializable` anymore
8-
* Remove all classes in the `Core\Encoder\` sub-namespace, use the `PasswordHasher` component instead
8+
* Remove all classes in the `Core\Encoder\` sub-namespace, use the `PasswordHasher` component instead
9+
* Remove methods `getPassword()` and `getSalt()` from `UserInterface`, use `PasswordAuthenticatedUserInterface`
10+
or `LegacyPasswordAuthenticatedUserInterface` instead
911

1012
5.3
1113
---

‎src/Symfony/Component/Security/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
2424
use Symfony\Component\Security\Core\User\InMemoryUser;
2525
use Symfony\Component\Security\Core\User\InMemoryUserProvider;
26+
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
2627
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
2728
use Symfony\Component\Security\Core\User\UserCheckerInterface;
2829
use Symfony\Component\Security\Core\User\UserInterface;
@@ -188,7 +189,7 @@ public function testCheckAuthenticationWhenCredentialsAreNotValid()
188189
public function testCheckAuthenticationDoesNotReauthenticateWhenPasswordHasChanged()
189190
{
190191
$this->expectException(BadCredentialsException::class);
191-
$user = $this->createMock(UserInterface::class);
192+
$user = $this->createMock(TestUser::class);
192193
$user->expects($this->once())
193194
->method('getPassword')
194195
->willReturn('foo')
@@ -199,7 +200,7 @@ public function testCheckAuthenticationDoesNotReauthenticateWhenPasswordHasChang
199200
->method('getUser')
200201
->willReturn($user);
201202

202-
$dbUser = $this->createMock(UserInterface::class);
203+
$dbUser = $this->createMock(TestUser::class);
203204
$dbUser->expects($this->once())
204205
->method('getPassword')
205206
->willReturn('newFoo')
@@ -213,7 +214,7 @@ public function testCheckAuthenticationDoesNotReauthenticateWhenPasswordHasChang
213214

214215
public function testCheckAuthenticationWhenTokenNeedsReauthenticationWorksWithoutOriginalCredentials()
215216
{
216-
$user = $this->createMock(UserInterface::class);
217+
$user = $this->createMock(TestUser::class);
217218
$user->expects($this->once())
218219
->method('getPassword')
219220
->willReturn('foo')
@@ -224,7 +225,7 @@ public function testCheckAuthenticationWhenTokenNeedsReauthenticationWorksWithou
224225
->method('getUser')
225226
->willReturn($user);
226227

227-
$dbUser = $this->createMock(UserInterface::class);
228+
$dbUser = $this->createMock(TestUser::class);
228229
$dbUser->expects($this->once())
229230
->method('getPassword')
230231
->willReturn('foo')
@@ -338,7 +339,7 @@ protected function getProvider($user = null, $userChecker = null, $passwordHashe
338339
}
339340
}
340341

341-
class TestUser implements UserInterface
342+
class TestUser implements PasswordAuthenticatedUserInterface, UserInterface
342343
{
343344
public function getRoles(): array
344345
{
@@ -371,7 +372,7 @@ public function eraseCredentials()
371372
}
372373
interface PasswordUpgraderProvider extends UserProviderInterface, PasswordUpgraderInterface
373374
{
374-
public function upgradePassword(UserInterface $user, string $newHashedPassword): void;
375+
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void;
375376

376377
public function loadUserByIdentifier(string $identifier): UserInterface;
377378
}

‎src/Symfony/Component/Security/Core/User/ChainUserProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/User/ChainUserProvider.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ public function supportsClass(string $class)
128128
/**
129129
* {@inheritdoc}
130130
*/
131-
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newEncodedPassword): void
131+
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
132132
{
133133
foreach ($this->providers as $provider) {
134134
if ($provider instanceof PasswordUpgraderInterface) {
135135
try {
136-
$provider->upgradePassword($user, $newEncodedPassword);
136+
$provider->upgradePassword($user, $newHashedPassword);
137137
} catch (UnsupportedUserException $e) {
138138
// ignore: password upgrades are opportunistic
139139
}

‎src/Symfony/Component/Security/Core/User/PasswordUpgraderInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/User/PasswordUpgraderInterface.php
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313

1414
/**
1515
* @author Nicolas Grekas <p@tchwork.com>
16-
*
17-
* @method void upgradePassword(PasswordAuthenticatedUserInterface|UserInterface $user, string $newHashedPassword) Upgrades the hashed password of a user, typically for using a better hash algorithm.
18-
* This method should persist the new password in the user storage and update the $user object accordingly.
19-
* Because you don't want your users not being able to log in, this method should be opportunistic:
20-
* it's fine if it does nothing or if it fails without throwing any exception.
2116
*/
2217
interface PasswordUpgraderInterface
2318
{
19+
/**
20+
* Upgrades the hashed password of a user, typically for using a better hash algorithm.
21+
*
22+
* This method should persist the new password in the user storage and update the $user object accordingly.
23+
* Because you don't want your users not being able to log in, this method should be opportunistic:
24+
* it's fine if it does nothing or if it fails without throwing any exception.
25+
*/
26+
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void;
2427
}

‎src/Symfony/Component/Security/Core/User/UserInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/User/UserInterface.php
-23Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,6 @@ interface UserInterface
4848
*/
4949
public function getRoles();
5050

51-
/**
52-
* Returns the password used to authenticate the user.
53-
*
54-
* This should be the hashed password. On authentication, a plain-text
55-
* password will be hashed, and then compared to this value.
56-
*
57-
* This method is deprecated since Symfony 5.3, implement it from {@link PasswordAuthenticatedUserInterface} instead.
58-
*
59-
* @return string|null The hashed password if any
60-
*/
61-
public function getPassword();
62-
63-
/**
64-
* Returns the salt that was originally used to hash the password.
65-
*
66-
* This can return null if the password was not hashed using a salt.
67-
*
68-
* This method is deprecated since Symfony 5.3, implement it from {@link LegacyPasswordAuthenticatedUserInterface} instead.
69-
*
70-
* @return string|null The salt
71-
*/
72-
public function getSalt();
73-
7451
/**
7552
* Removes sensitive data from the user.
7653
*

‎src/Symfony/Component/Security/Core/Validator/Constraints/UserPasswordValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Validator/Constraints/UserPasswordValidator.php
+2-12Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1616
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
1717
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
18-
use Symfony\Component\Security\Core\User\UserInterface;
1918
use Symfony\Component\Validator\Constraint;
2019
use Symfony\Component\Validator\ConstraintValidator;
2120
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
@@ -53,22 +52,13 @@ public function validate(mixed $password, Constraint $constraint)
5352

5453
$user = $this->tokenStorage->getToken()->getUser();
5554

56-
if (!$user instanceof UserInterface) {
57-
throw new ConstraintDefinitionException('The User object must implement the UserInterface interface.');
58-
}
59-
6055
if (!$user instanceof PasswordAuthenticatedUserInterface) {
61-
trigger_deprecation('symfony/security-core', '5.3', 'Using the "%s" validation constraint without implementing the "%s" interface is deprecated, the "%s" class should implement it.', UserPassword::class, PasswordAuthenticatedUserInterface::class, get_debug_type($user));
62-
}
63-
64-
$salt = $user->getSalt();
65-
if ($salt && !$user instanceof LegacyPasswordAuthenticatedUserInterface) {
66-
trigger_deprecation('symfony/security-core', '5.3', 'Returning a string from "getSalt()" without implementing the "%s" interface is deprecated, the "%s" class should implement it.', LegacyPasswordAuthenticatedUserInterface::class, get_debug_type($user));
56+
throw new ConstraintDefinitionException(sprintf('The "%s" class must implement the "%s" interface.', PasswordAuthenticatedUserInterface::class, get_debug_type($user)));
6757
}
6858

6959
$hasher = $this->hasherFactory->getPasswordHasher($user);
7060

71-
if (null === $user->getPassword() || !$hasher->verify($user->getPassword(), $password, $user->getSalt())) {
61+
if (null === $user->getPassword() || !$hasher->verify($user->getPassword(), $password, $user instanceof LegacyPasswordAuthenticatedUserInterface ? $user->getSalt() : null)) {
7262
$this->context->addViolation($constraint->message);
7363
}
7464
}

‎src/Symfony/Component/Security/Http/EventListener/CheckCredentialsListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/EventListener/CheckCredentialsListener.php
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function checkPassport(CheckPassportEvent $event): void
4747
$user = $passport->getUser();
4848

4949
if (!$user instanceof PasswordAuthenticatedUserInterface) {
50-
trigger_deprecation('symfony/security-http', '5.3', 'Not implementing the "%s" interface in class "%s" while using password-based authentication is deprecated.', PasswordAuthenticatedUserInterface::class, get_debug_type($user));
50+
throw new \LogicException(sprintf('Class "%s" must implement "%s" for using password-based authentication.',get_debug_type($user), PasswordAuthenticatedUserInterface::class));
5151
}
5252

5353
/** @var PasswordCredentials $badge */
@@ -66,12 +66,7 @@ public function checkPassport(CheckPassportEvent $event): void
6666
throw new BadCredentialsException('The presented password is invalid.');
6767
}
6868

69-
$salt = $user->getSalt();
70-
if ($salt && !$user instanceof LegacyPasswordAuthenticatedUserInterface) {
71-
trigger_deprecation('symfony/security-http', '5.3', 'Returning a string from "getSalt()" without implementing the "%s" interface is deprecated, the "%s" class should implement it.', LegacyPasswordAuthenticatedUserInterface::class, get_debug_type($user));
72-
}
73-
74-
if (!$this->hasherFactory->getPasswordHasher($user)->verify($user->getPassword(), $presentedPassword, $salt)) {
69+
if (!$this->hasherFactory->getPasswordHasher($user)->verify($user->getPassword(), $presentedPassword, $user instanceof LegacyPasswordAuthenticatedUserInterface ? $user->getSalt() : null)) {
7570
throw new BadCredentialsException('The presented password is invalid.');
7671
}
7772

‎src/Symfony/Component/Security/Http/EventListener/PasswordMigratingListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/EventListener/PasswordMigratingListener.php
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1515
use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface;
1616
use Symfony\Component\PasswordHasher\PasswordHasherInterface;
17+
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
18+
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
1719
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
1820
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\PasswordUpgradeBadge;
1921
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
@@ -50,7 +52,7 @@ public function onLoginSuccess(LoginSuccessEvent $event): void
5052
}
5153

5254
$user = $passport->getUser();
53-
if (null === $user->getPassword()) {
55+
if (!$user instanceof PasswordAuthenticatedUserInterface || null === $user->getPassword()) {
5456
return;
5557
}
5658

@@ -76,7 +78,7 @@ public function onLoginSuccess(LoginSuccessEvent $event): void
7678
}
7779
}
7880

79-
$passwordUpgrader->upgradePassword($user, $passwordHasher instanceof PasswordHasherInterface ? $passwordHasher->hash($plaintextPassword, $user->getSalt()) : $passwordHasher->encodePassword($plaintextPassword, $user->getSalt()));
81+
$passwordUpgrader->upgradePassword($user, $passwordHasher->hash($plaintextPassword, $user instanceof LegacyPasswordAuthenticatedUserInterface ? $user->getSalt() : null));
8082
}
8183

8284
public static function getSubscribedEvents(): array

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.