Skip to content

Fix Exception on empty JSON login: BadCredentials message too generic #61152

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Yashingle1307
Copy link

Q A
Branch? 7.4 for features / 6.4, 7.2, or 7.3 for bug fixes
Bug fix? yes/no
New feature? yes/no
Deprecations? yes/no
Issues Fix #...
License MIT

@Yashingle1307 Yashingle1307 changed the base branch from 7.4 to 6.4 July 18, 2025 11:11
@Yashingle1307 Yashingle1307 changed the base branch from 6.4 to 7.4 July 18, 2025 11:16
@@ -147,7 +148,7 @@ private function getCredentials(\stdClass $data): array
$credentials['username'] = $this->propertyAccessor->getValue($data, $this->options['username_path']);

if (!\is_string($credentials['username']) || '' === $credentials['username']) {
throw new BadRequestHttpException(\sprintf('The key "%s" must be a non-empty string.', $this->options['username_path']));
throw new BadCredentialsException('The key "username" must be a non-empty string.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default for option username_path is "username", so I'm missing what this PR provides. The resulting message will be exactly the same to me. And when one changes the value of the option, then the message might be considered less accurate actually.

@symfony symfony deleted a comment from carsonbot Jul 21, 2025
@symfony symfony deleted a comment from carsonbot Jul 21, 2025
@Yashingle1307 Yashingle1307 closed this by deleting the head repository Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy