Skip to content

Commit

Permalink
minor #35472 [Security] Improved error message when no supported user…
Browse files Browse the repository at this point in the history
… provider is found (wouterj)

This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

[Security] Improved error message when no supported user provider is found

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35435
| License       | MIT
| Doc PR        | -

Commits
-------

6b2db6d Improved error message when no supported user provider is found
  • Loading branch information
nicolas-grekas committed Jan 27, 2020
2 parents d90a503 + 6b2db6d commit b90664b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -91,7 +91,7 @@ public function refreshUser(UserInterface $user)
$e->setUsername($user->getUsername());
throw $e;
} else {
throw new UnsupportedUserException(sprintf('The account "%s" is not supported.', \get_class($user)));
throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', \get_class($user)));
}
}

Expand Down
Expand Up @@ -238,7 +238,7 @@ protected function refreshUser(TokenInterface $token)
return null;
}

throw new \RuntimeException(sprintf('There is no user provider for user "%s".', $userClass));
throw new \RuntimeException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $userClass));
}

private function safelyUnserialize($serializedToken)
Expand Down
Expand Up @@ -239,7 +239,7 @@ final protected function getUserProvider($class)
}
}

throw new UnsupportedUserException(sprintf('There is no user provider that supports class "%s".', $class));
throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $class));
}

/**
Expand Down

0 comments on commit b90664b

Please sign in to comment.