How to definitely disable registration in FOSUserBundle

后端 未结 7 2412
无人及你
无人及你 2021-02-19 03:02

In my project, I allow only one user to manage the content of the website. This user will be added using the command line at first.

Now, I want to get the registration a

7条回答
  •  逝去的感伤
    2021-02-19 03:28

    You can just change app/config/security.yml:

    - { path: ^/register, role: ROLE_ADMIN }
    

    Change from the default (IS_AUTHENTICATED_ANONYMOUSLY) to ROLE_ADMIN and it will stop allowing anonymous users from getting to the /register form.

提交回复
热议问题