Overview
Based on the concept found on Settings section of Long Running Refresh Token.
It means that you need to refresh [access token] every 5 mins and you need to replace your refresh token in 7 days after it has been issued.
This will enable user to maintain refresh token session as long as we can refresh it within 7 days (e.g. 'JWT_REFRESH_EXPIRATION_DELTA': timedelta(days=7)
).
Note that you can't call refreshToken(refreshToken: $refreshToken)
with an expired refresh token as this may result in "message": "Refresh token is expired"
.
Problem
Now the struggle here is how do we know that the refresh token will expire in 7 days? So we can create a logic to check if it has 1 day left for the session then trigger a refreshToken()
mutation?
Conclusion
Without knowing the expiration date of a refresh token developers will have to integrate in storing the date after the refresh token has been issued in the client side to determine how old the refresh token is.
Well if I am missing something maybe there is already a simple approach how to handle the checking of refresh token expiration date?