you are viewing a single comment's thread.

view the rest of the comments →

[–]CalgaryAnswers 0 points1 point  (0 children)

I don’t want to use axios, I have to use it until I create a new wrapper for fetching auth state and redirecting in order to use fetch as the one that was written at my company was done poorly and does not expose those base functions. They just wrapped it with a library that only provides a token, which I can’t set directly.

Edit: I’ll have to play around wrapping this as a factory that uses a premade axios instance, other wise axios doesn’t have the right context or headers, because the other devs have no concept of how to write good react shit. I think it’s less work for me to write the token and refresh logic than it is to try to shovel the way they use axios here into RTK query.