How to set a login form for admins and another for other users using FOSUserBundle?

后端 未结 2 1948
栀梦
栀梦 2021-01-31 12:44

When having a backend for admin users, it is interesting to have a login form, and at the same time having a normal login form for normal users in the public area of our website

2条回答
  •  無奈伤痛
    2021-01-31 12:59

    Regarding to the approved answer, I made some adjustments in my Symfony 3.2.8 project in order to work correctly.

    Instead of $requestAttributes = $this->container->get('request')->attributes; in the Security Controller, I used $requestAttributes = $this->container->get('request_stack')->getCurrentRequest();.

提交回复
热议问题