简体   繁体   中英

Error when resetting password with fosuserbundle

I am using Symfony2 and Fosuserbundle on my website. But I have a problem when I want to reset my password.

  1. When I go to the /resetting/request page I first put my email.
  2. I receive an email with a link
  3. When I click at this link I can see a form with only the new password and a confirmation
  4. When I put the new password and the confirmation I receive this error message :

The lastname is required.

I didn't override the formtype or the controller, I just overrode the view like this on reset_content.html.twig

{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_resetting_reset', {'token': token}) }}" {{ form_enctype(form) }} method="POST" class="fos_user_resetting_reset">

    {{ form_widget(form) }}

    <div>
        <input class="btn btn-success" type="submit" value="{{ 'resetting.reset.submit'|trans }}" />
    </div>
</form>

What can I do to solve this problem ?

Thanks,

我发现了问题:我的用户实体中有一个布尔值属性断言notBlank,它导致该消息“需要姓氏”的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM