Skip to content

Commit

Permalink
fix #9356 [Security] Logger should manipulate the user reloaded from …
Browse files Browse the repository at this point in the history
…provider
  • Loading branch information
Matthieu Auger authored and fabpot committed Dec 20, 2013
1 parent ba856e6 commit eb86af9
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -156,18 +156,19 @@ private function refreshUser(TokenInterface $token)

foreach ($this->userProviders as $provider) {
try {
$token->setUser($provider->refreshUser($user));
$refreshedUser = $provider->refreshUser($user);
$token->setUser($refreshedUser);

if (null !== $this->logger) {
$this->logger->debug(sprintf('Username "%s" was reloaded from user provider.', $user->getUsername()));
$this->logger->debug(sprintf('Username "%s" was reloaded from user provider.', $refreshedUser->getUsername()));
}

return $token;
} catch (UnsupportedUserException $unsupported) {
// let's try the next user provider
} catch (UsernameNotFoundException $notFound) {
if (null !== $this->logger) {
$this->logger->warning(sprintf('Username "%s" could not be found.', $user->getUsername()));
$this->logger->warning(sprintf('Username "%s" could not be found.', $notFound->getUsername()));
}

return null;
Expand Down

0 comments on commit eb86af9

Please sign in to comment.