这个问题涉及到自定义AuthenticationHandler没有正确实现接口 - 为什么?
How to disable redirection after login_check in Symfony 2
我已经实现了该链接正好给出的解决方案,但我收到一条错误我通常理解,但这次没有。我的课完全实现了界面(我认为)。
致命错误:Foo \ AppBundle \ Handler \ AuthenticationHandler :: onAuthenticationSuccess()声明必须与/ Users/Me/Sites中的Symfony \ Component \ Security \ Http \ Authentication \ AuthenticationSuccessHandlerInterface :: onAuthenticationSuccess()兼容/github/Foo/Symfony/src/Foo/AppBundle/Handler/AuthenticationHandler.php第6行
class AuthenticationHandler implements
\Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface,
\Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface
{
function onAuthenticationSuccess(Request $request, TokenInterface $token) {
return new Response();
}
function onAuthenticationFailure(Request $request, AuthenticationException $exception) {
return new Response();
}
}
建议表示赞赏!
哇。我怎么错过:)非常感谢 – PorridgeBear 2012-01-04 21:23:11
非常感谢你:) – 2016-12-20 17:40:30