I have been trying to implement the answers from this so question SOQ
So far my function to exchange the refresh token for the access token is like:
const