diff --git a/LICENSE b/LICENSE index 5f3c3e9..2250a74 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2019-2024, European Union. +Copyright (c) 2019-2025, European Union. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/Security/CasAuthenticator.php b/src/Security/CasAuthenticator.php index bbf1983..d4f2b92 100644 --- a/src/Security/CasAuthenticator.php +++ b/src/Security/CasAuthenticator.php @@ -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');