Skip to content

feat: Trigger Authenticated event when loading user from token#298

Merged
Messhias merged 2 commits into
PHP-Open-Source-Saver:mainfrom
NielsJanssen:main
May 4, 2026
Merged

feat: Trigger Authenticated event when loading user from token#298
Messhias merged 2 commits into
PHP-Open-Source-Saver:mainfrom
NielsJanssen:main

Conversation

@NielsJanssen

Copy link
Copy Markdown
Contributor

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:

  • I've added tests for my changes or tests are not applicable
  • I've changed documentations or changes are not required
  • I've added my changes to CHANGELOG.md

Comment thread CHANGELOG.md Outdated
@Messhias Messhias merged commit 734f269 into PHP-Open-Source-Saver:main May 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants