How to set Authorization headers asynchronously #820
Unanswered
MattCheetham
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently using Kingfisher and trying to switch to Nuke. All is going well except I'm currently stuck on how to correctly add Authorization headers to my requests. In Kingfisher I'm able to set a
requestModifier
on the shared Kingfisher object that allows me to modify any requests before they go out, but I'm struggling to work this out with Nuke.I came across #331 which was a step in the right direction except setting the header in this way only sets it on first call and then the Authorization header is fixed. This is a problem as our token expires and has to be refreshed by an async method.
Ideally I need a way of intercepting each request that Nuke is about to make, and calling my async method that handles token retrieval/refresh and then returns that token to Nuke to be set on the
Authorization
header.I'm sure this must be doable as this is a pretty common requirement for requests.
Any help would be hugely appreciated.
Beta Was this translation helpful? Give feedback.
All reactions