https://kotlinlang.org logo
a

amar_1995

08/23/2020, 8:23 AM
What is recommended way to check user token expiry ? I want to check token expiry by calling server api(using retrofit) and If token expired then move to login screen from any activity or fragment.
j

John Leeroy

08/24/2020, 2:21 AM
I imagine there should be an endpoint where you can check or refresh your token. You can do this step when the user starts or resume their session. Otherwise, you can wait until a 401 or similar error happens and proceed to refresh the token and resume the original request.
8 Views