Getting the access token, and injecting into all fetch() requests #2206
Unanswered
simplenotezy
asked this question in
Help
Replies: 1 comment
-
Maybe you can refactor your fetcher into a custom hook that can use the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
I'd like to inject the accessToken into all requests called by my helper function, I currently have a helper function like so:
But I have to inject the authToken in every request, which is not very pretty. Do we have a way to fetch the accessToken without using
context
or usinguseSession()
? (which can only be used inside React components, and not in custom helper functions).Beta Was this translation helpful? Give feedback.
All reactions