File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,8 @@ value and then a User object is created::
70
70
$username = $userProvider->getUsernameForApiKey($apiKey);
71
71
72
72
if (!$username) {
73
- // this message will be returned to the client
73
+ // CAUTION: this message will be returned to the client
74
+ // (so don't put any un-trusted messages / error strings here)
74
75
throw new CustomUserMessageAuthenticationException(
75
76
sprintf('API Key "%s" does not exist.', $apiKey)
76
77
);
Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ the user::
47
47
try {
48
48
$user = $userProvider->loadUserByUsername($token->getUsername());
49
49
} catch (UsernameNotFoundException $e) {
50
- // error will be shown to the client
50
+ // CAUTION: this message will be returned to the client
51
+ // (so don't put any un-trusted messages / error strings here)
51
52
throw new CustomUserMessageAuthenticationException('Invalid username or password');
52
53
}
53
54
@@ -56,7 +57,8 @@ the user::
56
57
if ($passwordValid) {
57
58
$currentHour = date('G');
58
59
if ($currentHour < 14 || $currentHour > 16) {
59
- // error will be shown to the client
60
+ // CAUTION: this message will be returned to the client
61
+ // (so don't put any un-trusted messages / error strings here)
60
62
throw new CustomUserMessageAuthenticationException(
61
63
'You can only log in between 2 and 4!',
62
64
100
@@ -71,7 +73,8 @@ the user::
71
73
);
72
74
}
73
75
74
- // error will be shown to the client
76
+ // CAUTION: this message will be returned to the client
77
+ // (so don't put any un-trusted messages / error strings here)
75
78
throw new CustomUserMessageAuthenticationException('Invalid username or password');
76
79
}
77
80
You can’t perform that action at this time.
0 commit comments