From 4392b44554a3dd0a017ffdc4dedf1b77863f5649 Mon Sep 17 00:00:00 2001 From: Samson Radu Date: Tue, 28 Jan 2025 10:34:10 +0100 Subject: [PATCH 1/3] Do not redirect ajax requests on auth success --- src/Security/CasAuthenticator.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Security/CasAuthenticator.php b/src/Security/CasAuthenticator.php index bbf1983..bfb74c1 100644 --- a/src/Security/CasAuthenticator.php +++ b/src/Security/CasAuthenticator.php @@ -82,6 +82,11 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): Response { + // let the request through if it is an ajax request + if (true === $request->isXmlHttpRequest()) { + return null; + } + $request->query->remove('ticket'); $request->query->remove('renew'); From 7adc69508412970ea73bab460f0334afd5453ab3 Mon Sep 17 00:00:00 2001 From: Samson Radu Date: Tue, 28 Jan 2025 10:37:38 +0100 Subject: [PATCH 2/3] Return type fix --- src/Security/CasAuthenticator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Security/CasAuthenticator.php b/src/Security/CasAuthenticator.php index bfb74c1..10f3b3d 100644 --- a/src/Security/CasAuthenticator.php +++ b/src/Security/CasAuthenticator.php @@ -80,7 +80,7 @@ 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 { // let the request through if it is an ajax request if (true === $request->isXmlHttpRequest()) { From 6a776b5f4779cf54cc6508657926ad165c0d6df4 Mon Sep 17 00:00:00 2001 From: Radu SAMSON Date: Tue, 28 Jan 2025 15:01:35 +0100 Subject: [PATCH 3/3] 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