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.
2 years ago
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.