I am trying to create a login system inside Symfony2 that requires both a Username/Password and a PIN. This means that when the user presses the login submit button Symfony2 should check against the username, password and the pin.
我正在尝试在Symfony2中创建一个需要用户名/密码和PIN的登录系统。这意味着当用户按下登录提交按钮时,Symfony2应该检查用户名,密码和引脚。
I don't really know where to start. I have a valid login system working with just a username/password using the UserInterface.
我真的不知道从哪里开始。我有一个有效的登录系统,使用UserInterface只使用用户名/密码。
Any ideas? Thanks.
有任何想法吗?谢谢。
1 个解决方案
#1
0
Follow this tutorial In the listener catch the error with a RedirectResponse to your login page and set a session variable with:
遵循本教程在侦听器中使用RedirectResponse捕获错误到您的登录页面并设置会话变量:
$session->set(SecurityContext::AUTHENTICATION_ERROR, array('message' => 'The details entered are invalid'));
#1
0
Follow this tutorial In the listener catch the error with a RedirectResponse to your login page and set a session variable with:
遵循本教程在侦听器中使用RedirectResponse捕获错误到您的登录页面并设置会话变量:
$session->set(SecurityContext::AUTHENTICATION_ERROR, array('message' => 'The details entered are invalid'));