Skip to content

Commit

Permalink
Add status to the JSON response in case of failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 5, 2019
1 parent 0a81041 commit 518098e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Security/CasGuardAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,15 @@ public function getUser($response, UserProviderInterface $userProvider)
*/
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
return new JsonResponse([
'error' => 'Authentication failed.',
'reason' => $exception->getMessage(),
'description' => 'You have been redirected here to prevent infinite redirection loops between the CAS server and your application.',
]);
return new JsonResponse(
[
'error' => 'Authentication failed.',
'reason' => $exception->getMessage(),
'description' => 'You have been redirected here to prevent infinite redirection loops between the CAS server and your application.',
]
,
500
);
}

/**
Expand Down

0 comments on commit 518098e

Please sign in to comment.