Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Symfony2: Auth using Doctrine2 entity - password set to blank value after saving an entity
- security:
- encoders:
- ISELoginBundleEntityUser:
- algorithm: sha1
- iterations: 1
- encode_as_base64: false
- providers:
- main:
- entity:
- class: ISELoginBundleEntityUser
- property: username
- class User implements UserInterface {
- // ...
- public function eraseCredentials() {
- $this->password = null;
- $this->salt = null;
- }
- // ...
- }
- public function createAction() {
- // ...
- if ($form->isValid()) {
- $em = $this->get('doctrine')->getEntityManager();
- $em->persist($product);
- $em->flush();
- return $this->redirect($this->generateUrl('product_create', array('created' => true)));
- }
- // ...
- }
Add Comment
Please, Sign In to add comment