in android application ?
Our backend developer says you have to use a refresh token to refresh new token !
But i think it is bad way ! Because while user works with application and sends requests to server every minutes in average , in this case maybe token expired (after 1 day) so application send three request :
1. Sends request to fetch data and receives 401 (token expired )
2.sends request to refresh token
3.send request #1 to fetch data again .
.....
So is it normal or the best way ?
Actually with each access token and refrsh token, there is a "Expiration Time" too which you can save it on prefences and check if your token is valid or not
We do it this way and it works ok
Обсуждают сегодня