Has anyone figured out how to refresh a JWT using Remix and Apollo Client?
I’ve been trying (and failing) to refresh a JWT using Apollo Client and Remix. I’ve seen a number of solutions, and none of them seem to work correctly.
This one: /a/62872754/4107095 works somewhat, but it doesn’t seem to repeat the request as it’s supposed to. Instead it refreshes the token, but still reports a 401 error back. Subsequent requests work, but you get an error the first time.
I’ve also tried to redirect the application manually when the token expires, as described here: https://sergiodxa.com/articles/working-with-refresh-tokens-in-remix but that doesn’t work well because I need to throw a redirect from within a setContext
link, which results in an error being captured by Apollo and not handled.