8000 Update exception messages · symfony/symfony@e0bb4e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit e0bb4e4

Browse files
committed
Update exception messages
1 parent c3ab681 commit e0bb4e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Security/Http/Firewall/UsernamePasswordJsonAuthenticationListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,25 +77,25 @@ public function handle(GetResponseEvent $event)
7777
try {
7878
$username = $this->propertyAccessor->getValue($data, $this->options['username_path']);
7979
} catch (AccessException $e) {
80-
throw new BadCredentialsException(sprintf('Missing key "%s".', $this->options['username_path']));
80+
throw new BadCredentialsException(sprintf('The key "%s" must be provided.', $this->options['username_path']));
8181
}
8282

8383
try {
8484
$password = $this->propertyAccessor->getValue($data, $this->options['password_path']);
8585
} catch (AccessException $e) {
86-
throw new BadCredentialsException(sprintf('Missing key "%s".', $this->options['password_path']));
86+
throw new BadCredentialsException(sprintf('The key "%s" must be provided.', $this->options['password_path']));
8787
}
8888

8989
if (!is_string($username)) {
90-
throw new BadCredentialsException(sprintf('The key "%s" must contain a string.', $this->options['username_path']));
90+
throw new BadCredentialsException(sprintf('The key "%s" must be a string.', $this->options['username_path']));
9191
}
9292

9393
if (strlen($username) > Security::MAX_USERNAME_LENGTH) {
9494
throw new BadCredentialsException('Invalid username.');
9595
}
9696

9797
if (!is_string($password)) {
98-
throw new BadCredentialsException(sprintf('The key "%s" must contain a string.', $this->options['password_path']));
98+
throw new BadCredentialsException(sprintf('The key "%s" must be a string.', $this->options['password_path']));
9999
}
100100

101101
try {

0 commit comments

Comments
 (0)
0