I am using the Oauth.io phonegap-sdk for my Ionic app. I am having a problem updating my Oauth.io request object with a new access token. I am able to get the refresh token on the client side and I am able to successfully get a new access token using my refresh token from Spotify/Youtube but my new access token expires when the original token was supposed to expire. Below is the flow I am experiencing:
- User logs in and an access token and refresh token are received by my app in the callback
- Refresh token is sent to my server to be stored
- Use the refresh token server-side to obtain a new accesstoken every x minutes (currently using 10min)
- Send the new access token to the client side
- Update the access_token field in the Oauth.io request object
- Conduct new api requests
The new access tokens will work all the way up until the time the original token expires (@60min). Not sure why this is happening. Is there something else I need to do to update the request object? Thanks a ton for any help you can offer. This is the last thing before I work to release my app!