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

Appearance settings

Commit 10ecbe1

Browse filesBrowse files
committed
Update exception messages
1 parent 84114ad commit 10ecbe1
Copy full SHA for 10ecbe1

File tree

1 file changed

+4
-4
lines changed
Filter options

1 file changed

+4
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Firewall/UsernamePasswordJsonAuthenticationListener.php
+4-4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.