Skip to content

Commit

Permalink
Merge pull request #105 from samsonradu/ajax-reqs-no-redirect-on-success
Browse files Browse the repository at this point in the history
Ajax reqs no redirect on success
  • Loading branch information
drupol authored Jan 28, 2025
2 parents 852f954 + e0f36a5 commit 84ed355
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
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 84ed355

Please sign in to comment.