Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax reqs no redirect on success #105

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading