namespace App\Security;
final class User implements JWTUserInterface
{
// Your own logic
public function __construct($username, array $roles, $email)
use Symfony\Component\DependencyInjection\Attribute\Exclude;
#[Exclude]
final class User implements JWTUserInterface {}
Without this change, [CurrentUser] will not works, because class User will be "service" and DI will be broken.
https://symfony.com/blog/new-in-symfony-7-3-dependency-injection-improvements#resource-tags
https://symfony.com/bundles/LexikJWTAuthenticationBundle/current/8-jwt-user-provider.html
Need to change to
Without this change, [CurrentUser] will not works, because class User will be "service" and DI will be broken.