-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.7] Add guard to authentication events #25261
Conversation
Why not pass the whole Guard context ( |
Fair point about passing the whole Guard instance. I needed to add an additional Regarding tests: I couldn't find any checking the constructor arguments of the events. |
Passing the whole guard breaks any queued listeners as the Guards in general (SessionGuard for instance) relies on closures (see the request, provider and events properties, each have closure-based resolvers). I have a queued listener that updates a timestamp in the user's record whenever the To migrate some of them to Laravel 5.7 I had to make this listener synchronous (remove the I have some suggestions:
I can submit a PR for any of these alternatives as soon as we have a decision |
If this is really breaking in this way, it needs to be reverted. We can't say "no queued listeners" when listening for authentication events. |
I submitted issue #25566 with steps to reproduce. Also I imagine a new issue would get more attention than a comment on a merged PR |
Given your complete knowledge on the issue, I think it would be beneficial if you open a PR with the original intent as it might solve the issue while still offering the original feature. |
@deleugpn It seems the best option to me, but it would be a breaking change on a newly released version... I will send it anyway and maybe we can decide for a better approach later |
I think we can advocate that this was a major breakage because it broke the feature. I would argue in favour of the breaking change given the state of the feature. |
Sent the #25568 PR, working on the tests now. |
Ping @Propaganistas , please check if PR #25568 breaks your workflow |
Thanks for the heads up. |
I'm running into a situation where I need to fire some actions after logout, but only for a particular guard.
Currently there's no straightforward way to determine which guard was responsible for firing one of the authentication events.