Commit ed386d93 authored by Fabien Potencier's avatar Fabien Potencier

bug #1610 Fix Security provider context usage (hkdobrev)

This PR was merged into the 2.3.x-dev branch.

Discussion
----------

Fix Security provider context usage

Fixes #1568.

The `'context'` parameter is defaulting to the `'name'` parameter, but then it wasn't used properly below.

Commits
-------

d92d5c5a Fix Security provider context usage
parents c2a847f1 d92d5c5a
...@@ -230,12 +230,12 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener ...@@ -230,12 +230,12 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
$listeners = ['security.channel_listener']; $listeners = ['security.channel_listener'];
if ($protected) { if ($protected) {
if (!isset($app['security.context_listener.'.$name])) { if (!isset($app['security.context_listener.'.$context])) {
if (!isset($app['security.user_provider.'.$name])) { if (!isset($app['security.user_provider.'.$name])) {
$app['security.user_provider.'.$name] = is_array($users) ? $app['security.user_provider.inmemory._proto']($users) : $users; $app['security.user_provider.'.$name] = is_array($users) ? $app['security.user_provider.inmemory._proto']($users) : $users;
} }
$app['security.context_listener.'.$name] = $app['security.context_listener._proto']($name, [$app['security.user_provider.'.$name]]); $app['security.context_listener.'.$context] = $app['security.context_listener._proto']($name, [$app['security.user_provider.'.$name]]);
} }
if (false === $stateless) { if (false === $stateless) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment