Created
January 13, 2014 06:00
-
-
Save RickySu/8395370 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#app/config/security.yml | |
security: | |
providers: | |
fos_userbundle: | |
id: my.custom.user_provider.username_email |
This file contains hidden or 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
<!-- YourBundle/resource/config/service.xml --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<container xmlns="http://symfony.com/schema/dic/services" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | |
<services> | |
<service id="my.custom.user_provider.username_email" class="My\Custom\User\UserProvider" public="false"> | |
<argument type="service" id="fos_user.user_manager" /> | |
</service> | |
</services> | |
</container> |
This file contains hidden or 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 | |
namespace My\Custom\User; | |
use FOS\UserBundle\Security; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
class UserProvider extends EmailUserProvider | |
{ | |
public function refreshUser(UserInterface $user) | |
{ | |
return $user; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment