[Security] Add an option to disable the hasPreviousSession() check in AbstractAuthenticationListener
This commit is contained in:
parent
b34bdd4639
commit
0562463cb7
@ -36,6 +36,7 @@ abstract class AbstractFactory implements SecurityFactoryInterface
|
||||
'use_referer' => false,
|
||||
'failure_path' => null,
|
||||
'failure_forward' => false,
|
||||
'require_previous_session' => true,
|
||||
);
|
||||
|
||||
public function create(ContainerBuilder $container, $id, $config, $userProviderId, $defaultEntryPointId)
|
||||
|
@ -98,6 +98,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
|
||||
'use_referer' => false,
|
||||
'failure_path' => null,
|
||||
'failure_forward' => false,
|
||||
'require_previous_session' => true,
|
||||
), $options);
|
||||
$this->logger = $logger;
|
||||
$this->dispatcher = $dispatcher;
|
||||
@ -132,7 +133,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
|
||||
}
|
||||
|
||||
try {
|
||||
if (!$request->hasPreviousSession()) {
|
||||
if ($this->options['require_previous_session'] && !$request->hasPreviousSession()) {
|
||||
throw new SessionUnavailableException('Your session has timed out, or you have disabled cookies.');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user