[Security] removed an unused parameter in some private methods
This commit is contained in:
parent
825867208e
commit
f9f385252d
@ -149,14 +149,14 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
|
|||||||
if ($returnValue instanceof TokenInterface) {
|
if ($returnValue instanceof TokenInterface) {
|
||||||
$this->sessionStrategy->onAuthentication($request, $returnValue);
|
$this->sessionStrategy->onAuthentication($request, $returnValue);
|
||||||
|
|
||||||
$response = $this->onSuccess($event, $request, $returnValue);
|
$response = $this->onSuccess($request, $returnValue);
|
||||||
} elseif ($returnValue instanceof Response) {
|
} elseif ($returnValue instanceof Response) {
|
||||||
$response = $returnValue;
|
$response = $returnValue;
|
||||||
} else {
|
} else {
|
||||||
throw new \RuntimeException('attemptAuthentication() must either return a Response, an implementation of TokenInterface, or null.');
|
throw new \RuntimeException('attemptAuthentication() must either return a Response, an implementation of TokenInterface, or null.');
|
||||||
}
|
}
|
||||||
} catch (AuthenticationException $e) {
|
} catch (AuthenticationException $e) {
|
||||||
$response = $this->onFailure($event, $request, $e);
|
$response = $this->onFailure($request, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
$event->setResponse($response);
|
$event->setResponse($response);
|
||||||
@ -189,7 +189,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
|
|||||||
*/
|
*/
|
||||||
abstract protected function attemptAuthentication(Request $request);
|
abstract protected function attemptAuthentication(Request $request);
|
||||||
|
|
||||||
private function onFailure(GetResponseEvent $event, Request $request, AuthenticationException $failed)
|
private function onFailure(Request $request, AuthenticationException $failed)
|
||||||
{
|
{
|
||||||
if (null !== $this->logger) {
|
if (null !== $this->logger) {
|
||||||
$this->logger->info(sprintf('Authentication request failed: %s', $failed->getMessage()));
|
$this->logger->info(sprintf('Authentication request failed: %s', $failed->getMessage()));
|
||||||
@ -209,7 +209,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onSuccess(GetResponseEvent $event, Request $request, TokenInterface $token)
|
private function onSuccess(Request $request, TokenInterface $token)
|
||||||
{
|
{
|
||||||
if (null !== $this->logger) {
|
if (null !== $this->logger) {
|
||||||
$this->logger->info(sprintf('User "%s" has been authenticated successfully', $token->getUsername()));
|
$this->logger->info(sprintf('User "%s" has been authenticated successfully', $token->getUsername()));
|
||||||
|
Reference in New Issue
Block a user