feat: Trigger Authenticated event when loading user from token#298
Merged
Conversation
matsn0w
reviewed
May 1, 2026
Messhias
approved these changes
May 2, 2026
matsn0w
approved these changes
May 4, 2026
Messhias
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default Laravel session guard triggers the Authenticated event when a user is loaded from the session, this PR aims to make the JWTGuard consistent with that behaviour.
Description
Trigger the Authenticated event when loading a user from a token instead of only doing so when explicitly logging a token in. The Laravel Session guard also has this behaviour, and this creates a consistent event to listen to, to see which user is currently active. For example when implementing Sentry for logging this is the recommended event to listen to when registering a user scope.
Checklist:
CHANGELOG.md