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

Make onAuthenticationSuccess Response optional #48288

Open
wants to merge 1 commit into
base: 6.0
Choose a base branch
from

Conversation

db306
Copy link

@db306 db306 commented Nov 22, 2022

Q A
Branch? 6.0, 6.1, and 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT

Most authenticators currently use onAuthenticationSuccess with an optional Response. That's mainly due to usecases whereby we want to redirect specific users etc.

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "6.2" but it seems your PR description refers to branch "6.3 for features / 4.4, 5.4, 6.0, 6.1, or 6.2 for bug fixes ".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@db306 db306 changed the base branch from 6.2 to 6.0 Nov 22, 2022
@fabpot fabpot modified the milestones: 6.2, 6.3 Nov 23, 2022
@@ -31,5 +31,5 @@ interface AuthenticationSuccessHandlerInterface
* is called by authentication listeners inheriting from
* AbstractAuthenticationListener.
*/
public function onAuthenticationSuccess(Request $request, TokenInterface $token): Response;
public function onAuthenticationSuccess(Request $request, TokenInterface $token): ?Response;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a BC break, so not something we can do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Widening the return type to allow null is fine compiler-wise: https://3v4l.org/rDAPN, so only callers could be impacted. As this method is called by authenticators, I would be ok to do this on 6.3 (with changelog entry).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants