Is it possible to refresh the access token automatically? Something like:
- I call an endpoint and it returns with 401 Unauthorized because my access token is expired
- The TraktManager recognises this and calls
getAccessTokenFromRefreshToken and waits for the response
- if it's a success, the manager repeats the original request and calls the completion block with the new response, otherwise, it calls the completion block with the original error.
I wonder if it's possible to insert such logic into your library's mutableRequest methods because I'm not fully aware of the architecture of the project. Let me know your thoughts!
As I've already contributed to your project, I'm keen to make a PR based on our discussion here.
Thank you,
Attila (author of MoviX app)
Is it possible to refresh the access token automatically? Something like:
getAccessTokenFromRefreshTokenand waits for the responseI wonder if it's possible to insert such logic into your library's
mutableRequestmethods because I'm not fully aware of the architecture of the project. Let me know your thoughts!As I've already contributed to your project, I'm keen to make a PR based on our discussion here.
Thank you,
Attila (author of MoviX app)