Skip to content

Commit

Permalink
Fix: No redirect when it's an AJAX request
Browse files Browse the repository at this point in the history
  • Loading branch information
Radu SAMSON authored and Radu SAMSON committed Jan 28, 2025
1 parent 6a776b5 commit e0f36a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Security/CasAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
return new RedirectResponse($request->getUri());
}

public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): Response
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
{
// no redirect when it's an AJAX request
if (true === $request->isXmlHttpRequest()) {
return null;
}

$request->query->remove('ticket');
$request->query->remove('renew');

Expand Down

0 comments on commit e0f36a5

Please sign in to comment.