markitosgv/JWTRefreshTokenBundle

php8 doctrine annotation/attributes is a must

NgatiaFrankline opened this issue · 1 comments

Thank you for the great bundle. Am using symfony 6.0 with php8. I have already installed LexikJWTBundle and it works wonderful. Am extending it to have a reflesh token. I am using your bundle and after running composer require gesdinet/jwt-refresh-token-bundle it did not get Symfony Flex recipes so i had to make the chnages. From the installation guide (Step 3: Configure the Bundle, 2. Create the object class), you use doctrine annotation like this:

/**
 * @ORM\Entity
 * @ORM\Table("refresh_tokens")
 */
class RefreshToken extends BaseRefreshToken
{
}

I get a 500 error as folow:
Screenshot from 2022-05-05 21-06-00
It took me sometime to realize that am in php8 and i should change the doctrine annotation as follow:

#[ORM\Entity]
#[ORM\Table(name: 'refresh_tokens')]
class RefreshToken extends BaseRefreshToken
{
}

That solved the error. Kindly would you please update the documentation. Its also wise mentioning about it. Once again thank you for this wonderful bundle. I appreciate your effort.

Thank you so much, been an hour searching and it was this simple.