In reading https://symfony.com/doc/current/security/custom_provider.html#create-a-user-class/, all of the examples that I've seen implement the
If getSalt() returns nothing, then the submitted password is simply encoded using the algorithm you specify in security.yml. If a salt is specified, then the following value is created and then hashed ...
As stated in Creating your First User:
Do you need to use a Salt property?
If you use bcrypt, no. Otherwise, yes. All passwords must be hashed with a salt, but bcrypt does this internally. Since this tutorial does use bcrypt, the
getSalt()method in User can just
return null(it's not used). If you use a different algorithm, you'll need to uncomment the salt lines in the User entity and add a persisted salt property.
if you want to use Bcrypt just
return null in the