8000 minor #17919 [Security] Adding needsRehash() (ThomasLandauer) · symfony/symfony-docs@63338ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 63338ba

Browse files
committed
minor #17919 [Security] Adding needsRehash() (ThomasLandauer)
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Adding needsRehash() Page: https://symfony.com/doc/5.4/security/passwords.html#custom-password-hasher Adding this to comply with `PasswordHasherInterface` * I didn't check if this is really required in v5.4 already (but for sure in 6.2) Commits ------- a3bedbf Adding needsRehash()
2 parents 120d98a + a3bedbf commit 63338ba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

security/passwords.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,12 @@ If you need to create your own, it needs to follow these rules:
830830
831831
return $passwordIsValid;
832832
}
833+
834+
public function needsRehash(string $hashedPassword): bool
835+
{
836+
// Check if a password hash would benefit from rehashing
837+
return $needsRehash;
838+
}
833839
}
834840
835841
Now, define a password hasher using the ``id`` setting:

0 commit comments

Comments
 (0)
0