2014-10-13 3 views
22

나는 FOSUserBundle을 사용하여 사용자 권한 부여 및 등록을 제공합니다. 모든 것이 잘 작동하지만 내가 존재하지 않는 아이디를 사용하여 로그인하려고하면이 오류 얻을 : 나는 해결책을 찾는 노력했습니다FOSUserBundle - BadCredentialsException

exception 'Symfony\Component\Security\Core\Exception\BadCredentialsException' 
with message 'Bad credentials' in 
/var/www/OnTheWay/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php:73 
Stack trace: 
#0 /var/www/OnTheWay/app/cache/dev/classes.php(120): session_start() 
#1 /var/www/OnTheWay/app/cache/dev/classes.php(198): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() 
#2 /var/www/OnTheWay/app/cache/dev/classes.php(498): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag('attributes') 

,하지만 난 어떤 결과를 얻을하지 않았다. Github changelog에서

답변

79

:

에서 :

{% if error %} 
    ... {{ error|trans }} ... 
{% endif %} 

사람 :

{% if error %} 
    ... {{ error.messageKey|trans(error.messageData, 'security') }} ... 
{% endif %} 
, 당신이 당신의 사용자 정의 로그인 템플릿 login.html.twig를 업데이트해야

[BC break] The FOSUserBundle:Security:login.html.twig template now receives an AuthenticationException in the error variable rather than an error message.

이 문제를 해결하려면

+1

많은 사람에게 고마운) – nowiko

+1

감사합니다 백만 시간 – Gorcyn

+0

왜 그들은 지구상에서 그렇게하겠습니까 ???? –