Search code examples
symfonyjwttokenrefreshresponse

Adding data to the JWT refresh response


I use LexikJWTAuthenticationBundle and JWTRefreshTokenBundle with Symfony. I try to add custom data on jwt_refresh_token response but i can't. I know we can do it without refresh token using this, but i think jwt_refresh_token_bundle override this response.

Anyone have an idea how to add custom data on jwt_refresh_token response ? To get a response like this by example :

token: "..."
refresh_token: "..."
user: "..."

Thanks by advance.


Solution

  • I found my solution here. But in addition to this manipulation of priority, i need to remove the folowing code :

        if (!$user instanceof UserInterface) {
            return;
        }