Skip to content

Refresh access token automatically #44

Description

@hegedus90

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions