From 6a776b5f4779cf54cc6508657926ad165c0d6df4 Mon Sep 17 00:00:00 2001 From: Radu SAMSON Date: Tue, 28 Jan 2025 15:01:35 +0100 Subject: [PATCH 1/2] chore: bump LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From e0f36a53d07ef7d3d9b7b2991aa1022503639beb Mon Sep 17 00:00:00 2001 From: Radu SAMSON Date: Tue, 28 Jan 2025 15:18:47 +0100 Subject: [PATCH 2/2] Fix: No redirect when it's an AJAX request --- src/Security/CasAuthenticator.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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');