I am trying to also send the user details in the refresh token response using Doorkeeper (I am using it on API only). I tried calling the Doorkeeper::TokensController#create method in one of my other controllers, but it does not work. As a workaround, I created a new controller that inherits from Doorkeeper::TokensController and in the create method I try to do render json: { tokens: JSON.parse(super), user: the_instance_i_want }, but this would do render twice, as this method also has a render.
Is there any other way to solve this? I would also want to refresh the user data when refreshing the token.
You should render the same response for first jwt issue and refresh's. Anyway you can override
TokenResponsebodymethod: