8000 [Security] Do not make PasswordUpgraderInterface a generic · symfony/symfony@d473b90 · GitHub
[go: up one dir, main page]

Skip to content

Commit d473b90

Browse files
committed
[Security] Do not make PasswordUpgraderInterface a generic
1 parent 4606073 commit d473b90

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function upgradePassword(PasswordAuthenticatedUserInterface $user, string
125125
}
126126

127127
$repository = $this->getRepository();
128-
if ($repository instanceof PasswordUpgraderInterface) {
128+
if ($user instanceof PasswordAuthenticatedUserInterface && $repository instanceof PasswordUpgraderInterface) {
129129
$repository->upgradePassword($user, $newHashedPassword);
130130
}
131131
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
/**
1515
* @author Nicolas Grekas <p@tchwork.com>
16-
*
17-
* @template TUser of PasswordAuthenticatedUserInterface
1816
*/
1917
interface PasswordUpgraderInterface
2018
{
@@ -24,8 +22,6 @@ interface PasswordUpgraderInterface
2422
* This method should persist the new password in the user storage and update the $user object accordingly.
2523
* Because you don't want your users not being able to log in, this method should be opportunistic:
2624
* it's fine if it does nothing or if it fails without throwing any exception.
27-
*
28-
* @param TUser $user
2925
*/
3026
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void;
3127
}

0 commit comments

Comments
 (0)
0