Skip to content

Commit

Permalink
bug silexphp#1641 Set new security.user_provider inside existing cont…
Browse files Browse the repository at this point in the history
…ext (719media)

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

Discussion
----------

Set new security.user_provider inside existing context

Set `$app['security.user_provider.'.$name]` even if the context already exists. See silexphp#1640

Commits
-------

a3b1545 Set `$app['security.user_provider.'.$name]`
  • Loading branch information
fabpot committed Jun 2, 2018
2 parents 7fec666 + a3b1545 commit 2065bd6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Silex/Provider/SecurityServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,10 @@ public function register(Container $app)
}

if ($protected) {
if (!isset($app['security.user_provider.'.$name])) {
$app['security.user_provider.'.$name] = is_array($users) ? $app['security.user_provider.inmemory._proto']($users) : $users;
}
if (!isset($app['security.context_listener.'.$context])) {
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.context_listener.'.$context] = $app['security.context_listener._proto']($name, [$app['security.user_provider.'.$name]]);
}

Expand Down

0 comments on commit 2065bd6

Please sign in to comment.