0
我想重定向用戶在授權成功後更改密碼錶單並且出現此錯誤: OutOfBoundsException:索引「1」不是在[0,0]的範圍內。Symfony 2 OutOfBoundsException:索引「1」不在範圍[0,0]
namespace Infogold\KonsultantBundle\Service;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\RouterInterface;
/**
* Custom authentication success handler
*/
class AuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface
{
protected $router;
/**
* Constructor
* @param RouterInterface $router
*/
public function __construct(RouterInterface $router)
{
$this->router = $router;
}
function onAuthenticationSuccess(Request $request, TokenInterface $token)
{
.
.
.
我的服務
parameters:
security.authentication.success_handler.class: Infogold\KonsultantBundle\Service\AuthenticationSuccessHandler
services:
security.authentication.success_handler:
class: %security.authentication.success_handler.class%
arguments: ['@router']
,並與兩個防火牆安全,首先是我的防火牆二是從FOSuserBundle:
firewalls:
konsultant_area:
pattern: ^/konsultant
context: my_context1
anonymous: true
form_login:
provider: administrators
use_forward: true
login_path: /konsultant/login
check_path: /konsultant/login_check
post_only: true
always_use_default_target_path: true
default_target_path: /konsultant/klient/indywidualni
use_referer: false
success_handler: security.authentication.success_handler
failure_path: /konsultant/login
failure_forward: false
username_parameter: _username
password_parameter: _password
logout: true
main:
pattern: ^/
context: my_context2
.
.
.