11.
Configuring the Encoder in security.yml
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
5 Comments
Hi guys, there is an '+' missing on line src/AppBundle/DataFixtures/ORM/fixtures.yml:25. Excelento work!
Hey Juan carlos
I just downloaded the course code and I can see the "+" on that line (and it is on the code blocks as well). Could you double check it?
Cheers!
May not be in the code, but in your web.
If you are having issues with your event listener picking up the hash password listener in 3.4
Your service yml should look like this so that the fixtures generate the hashed passwords.
app.doctrine.hash_password_listener:
class: AppBundle\Doctrine\HashPasswordListener
autowire: true
tags:
- { name: doctrine.event_listener, event: prePersist, lazy: true }
Hey Sara!
Your code WILL totally work. But, the code in the tutorial should work too. Does your HashPasswordListener implement the EventSubscriber interface? Basically, there are 2 valid ways to create "listeners" - the tutorial shows the "subscriber" method. You are (actually, perfectly) showing the other method or configuring it.
Oh, and the lazy: true part is not needed, but a nice idea - it gives you a small performance boost when Doctrine is working, but your listener is not actually needed. Good find ;). In Symfony 4.2, that config will be ON by default... because it's just THAT awesome :p.
Cheers!
"Houston: no signs of life"
Start the conversation!