Have you considered using their SDK ? I have been using the Node one for over a year and I don't have their issue as it deals with all the reauth steps. It should make your life easier