$user =
$token->
getUser();
$userNotFoundByProvider = false;
$userDeauthenticated = false;
$userClass =
$user::
class;
foreach ($this->userProviders
as $provider) { if (!
$provider instanceof UserProviderInterface
) { throw new \
InvalidArgumentException(sprintf('User provider "%s" must implement "%s".',
get_debug_type($provider), UserProviderInterface::
class));
} if (!
$provider->
supportsClass($userClass)) { continue;
} try { $refreshedUser =
$provider->
refreshUser($user);
$newToken =
clone $token;
$newToken->
setUser($refreshedUser, false
);
// tokens can be deauthenticated if the user has been changed.
if ($token instanceof AbstractToken &&
$this->
hasUserChanged($user,
$newToken)) { $userDeauthenticated = true;