Skip to content

Add #[Exclude] attribute to JWTUserInterface sample implementation - #1318

Open
mikoajp wants to merge 1 commit into
lexik:3.xfrom
mikoajp:fix/jwt-user-provider-exclude-attribute
Open

mikoajp wants to merge 1 commit into
lexik:3.xfrom
mikoajp:fix/jwt-user-provider-exclude-attribute

Conversation

@mikoajp

@mikoajp mikoajp commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Problem

Symfony 7.3 introduced resource tags which automatically register classes
in App\Security as services. Without the #[Exclude] attribute, the
User class implementing JWTUserInterface gets registered as a service,
breaking the #[CurrentUser] functionality.

See: https://symfony.com/blog/new-in-symfony-7-3-dependency-injection-improvements#resource-tags

Fixes #1288

Symfony 7.3 introduced resource tags which cause classes in App\Security
to be registered as services automatically. Without the #[Exclude] attribute,
the User class implementing JWTUserInterface gets registered as a service,
breaking the #[CurrentUser] functionality.

Fixes lexik#1288
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.

Symfony 7.3 resource tags, need to update documentation

1 participant