Skip to content

Commit 671aeab

Browse files
committed
[Security] Run functional tests also for the authenticator system
1 parent 8ea60d6 commit 671aeab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Authenticator/JsonLoginAuthenticator.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,14 @@ public function supports(Request $request): ?bool
7979

8080
public function authenticate(Request $request): PassportInterface
8181
{
82-
$credentials = $this->getCredentials($request);
82+
try {
83+
$credentials = $this->getCredentials($request);
84+
} catch (BadRequestHttpException $e) {
85+
$request->setRequestFormat('json');
86+
87+
throw $e;
88+
}
89+
8390
$user = $this->userProvider->loadUserByUsername($credentials['username']);
8491
if (!$user instanceof UserInterface) {
8592
throw new AuthenticationServiceException('The user provider must return a UserInterface object.');

0 commit comments

Comments
 (0)