Skip to content

Commit

Permalink
[FrameworkBundle] added a way to configure the logout paths
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Oct 20, 2010
1 parent cb8161d commit 71228b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Expand Up @@ -204,6 +204,14 @@ protected function createFirewall(ContainerBuilder $container, $firewall, $provi
// Logout listener
if (array_key_exists('logout', $firewall)) {
$listeners[] = new Reference('security.logout_listener');

if (isset($firewall['logout']['path'])) {
$container->setParameter('security.authentication.form.logout_path', $firewall['logout']['path']);
}

if (isset($firewall['logout']['target'])) {
$container->setParameter('security.authentication.form.target_path', $firewall['logout']['target']);
}
}

// Authentication listeners
Expand Down
Expand Up @@ -27,6 +27,7 @@
<parameter key="security.authentication.form.login_path">/login</parameter>
<parameter key="security.authentication.form.check_path">/login_check</parameter>
<parameter key="security.authentication.form.logout_path">/logout</parameter>
<parameter key="security.authentication.form.target_path">/</parameter>
<parameter key="security.authentication.listener.form.class">Symfony\Component\HttpKernel\Security\Firewall\UsernamePasswordFormAuthenticationListener</parameter>
<parameter key="security.authentication.listener.options">
<parameter key="login_path">%security.authentication.form.login_path%</parameter>
Expand Down Expand Up @@ -116,6 +117,7 @@
<service id="security.logout_listener" class="%security.logout_listener.class%">
<argument type="service" id="security.context" />
<argument>%security.authentication.form.logout_path%</argument>
<argument>%security.authentication.form.target_path%</argument>
</service>

<service id="security.channel_listener" class="%security.channel_listener.class%">
Expand Down

0 comments on commit 71228b5

Please sign in to comment.