Last active
October 21, 2015 12:25
-
-
Save Etheriq/1562e86578796dbb920f to your computer and use it in GitHub Desktop.
example custom password generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function encodePassword(User $user, $plainPassword) | |
{ | |
/** @var \Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface $encoder */ | |
$encoder = $this->container->get('security.encoder_factory') | |
->getEncoder($user); | |
return $encoder->encodePassword($plainPassword, $user->getSalt()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment