Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
linniksa wants to merge1 commit intosymfony:2.3fromlinniksa:patch-translate-bad-credential-message
Closed

[Security] [Translator] Add translation to 'Bad credentials' message#13437

linniksa wants to merge1 commit intosymfony:2.3fromlinniksa:patch-translate-bad-credential-message

Conversation

@linniksa
Copy link
Contributor

QA
Fixed tickets-
LicenseMIT

For 2.6 source message should be updated (add dot to the end, see#11215)

linniksa referenced this pull request in FriendsOfSymfony/FOSUserBundleJan 17, 2015
The authentication exception messages are not translated using thetranslations shipped with Symfony itself.
@stof
Copy link
Member

This looks wrong to me. The message key of the BadCredentialsException isInvalid credentials. (which is already translated), notBad credentials.

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
Copy link
ContributorAuthor

We usehttps://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Controller/SecurityController.php#L38
Bad credentials has more sense for user thanInvalid credentials, it mean in most cases "You sent wrong username or password" instead of "Something wrong"
But you are right, i missed the standard way to translate error messages of authentication.

@linniksalinniksa deleted the patch-translate-bad-credential-message branchJanuary 18, 2015 15:42
@stof
Copy link
Member

@linniksa if you are using FOSUserBundle 1.3, you are not using the Symfony translation messages

@linniksa
Copy link
ContributorAuthor

@stof Why not? I can change the default template.

@stof
Copy link
Member

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
Copy link
ContributorAuthor

I know that the default translation domain is FosUserBundlehttps://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resources/views/Security/login.html.twig#L5
Bad credentials a string in symfony code, and the meaning of my pull request is to put a translation in symfony.
You point me standart way of translate auth exceptions (as described in docs) and i agree that in this case, my PR has little meaning

@stof
Copy link
Member

@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)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@linniksa@stof

[8]ページ先頭

©2009-2025 Movatter.jp