Fetch code using js and refresh_token using api-client gem