2014-10-13 22 views
22

Kullanıcı yetki ve kayıt sağlamak için FOSUserBundle kullanıyorum. Her şey çalışıyor, ama varolmayan bir kullanıcı adı kullanarak giriş çalıştığınızda bu hatayı alıyorum: Bir çözüm bulmak denedimFOSUserBundle - 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') 

, ama hiç sonuç alamadım. Github changelog itibaren

cevap

79

:

: From:

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

için:

{% if error %} 
    ... {{ error.messageKey|trans(error.messageData, 'security') }} ... 
{% endif %} 
, kendi özel giriş şablonu login.html.twig güncellemeniz gerekir

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

sorunu gidermek için

+1

çok teşekkür ederim) – nowiko

+1

Milyonlarca kez teşekkürler – Gorcyn

+0

Neden yeryüzünde böyle yaparlar ???? –

İlgili konular