10000 Adding needsRehash() · symfony/symfony-docs@a3bedbf · GitHub
[go: up one dir, main page]

Skip to content

Commit a3bedbf

Browse files
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)
1 parent 6cf5c14 commit a3bedbf

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