Sample for using OkHTTP interceptor for RxKotlin and Retrofit
- Interceptor will add the token into preference once after login
- Interceptor try to run the request once using current token in the OKHttp builder class
- If failed, it'll intercept by calling TokenRefreshInterceptor.kt
- TokenRefreshInterceptor.kt will try again, if got 200 from API
- It'll call the refresh API by appending refresh token from preference to refresh the token
- Then proceed to call original request in makeTokenRefreshCall