Closed prateek3255 closed 3 years ago
Hi @prateek3255, thanks for the detailed issue.
Not very into RxSwift myself, but my guess would be to capture 401 calls on catchError
, call your refresh token endpoint, and retry the failing call if refresh is successful.
I think it could be helpful to demonstrate this kind of behavior in the ios-base, so we may update on this issue.
Closing due to the removal of Moya dependency
I am pretty new to RxSwift and I am using the code from the branch mvvm+rxSwift, which has the following function for a request of given ProviderType -
This works pretty well, but now I want to retry the request when the request fails with a status code of 401, after fetching the refresh token. I found this comment on a GitHub issue which tells how it can be achieved but I am still confused how it will work in my case (the comment does not provide context related to how the refresh token mechanism works).