這個問題涉及到自定義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