Hi community!
I'm using react native as a front-end and working with refresh tokens. The tokens are checked on each request via an axios interceptor. Everything works fine while using the app. Tokens are refreshing, and when the access_token expires, a new one is requested with the refresh_token.
HOWEVER, when I leave my app closed for a while and open it again, the app tries to request a refresh_token, but it always gets a 401 error with INVALID_CREDENTIALS. The refersh_token is set for 30 days, so I don't understand why the post request throws this error...
The code: https://goonlinetools.com/snapshot/code/#5nbjk2xjlk3jzodyzc7oyr
The Share Code Snippets Tool helps you to easily share code snippets online with your developer friends or colleagues.