Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Security] [Translator] Add translation to 'Bad credentials' message#13437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The authentication exception messages are not translated using thetranslations shipped with Symfony itself.
stof commentedJan 18, 2015
This looks wrong to me. The message key of the BadCredentialsException is It looks to me that you are rendering the security exceptions using their unsafe message rather than their safe message key (the exception message itself can leak informations about your DB structure for instance, in case it comes from a PDO exception. It is not safe to display it for end users) 👎 |
linniksa commentedJan 18, 2015
We usehttps://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Controller/SecurityController.php#L38 |
stof commentedJan 18, 2015
@linniksa if you are using FOSUserBundle 1.3, you are not using the Symfony translation messages |
linniksa commentedJan 18, 2015
@stof Why not? I can change the default template. |
stof commentedJan 18, 2015
Well, FOSUserBundle 1.3 does not give you the Symfony translation key. This means that you are translatingother stuff, expecting them to be provided by the Symfony translations |
linniksa commentedJan 18, 2015
I know that the default translation domain is FosUserBundlehttps://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resources/views/Security/login.html.twig#L5 |
stof commentedJan 18, 2015
@linniksa Symfony does not provide translation for exception messages. It provides only translations for strings it considers as translation keys. Exception messages are not because they are targetted at developers, not at being displayed in the interface for end users (they are not safe to be displayed there as they might leak internal implementation details) |
For 2.6 source message should be updated (add dot to the end, see#11215)