0

So I currently face the situation when a logged in user token expires and for any of his requests to succeed refresh token call needs to be performed first. how should I design my requests.

//Network Calls Observable<UserResponse> login(/*params*/); Observable<RefreshTokenResponse> refreshToken(/*params*/); Observable<GetAddressListResponse> getAddressList(/*params*/)

Abdelrhman Talat
  • 1,205
  • 2
  • 13
  • 25

1 Answers1

0

Recently I developed the library that suits your needs.

RetrofitRxErrorHandler

If you combine Simple strategy reacting to HTTP error code with backup Observable you will get the expected result.

However it is for RxJava 1. You are welcome to improve it and align it to RxJava 2.

R. Zagórski
  • 20,020
  • 5
  • 65
  • 90