heroku / heroku/react-refetch

Making additional request in handleResponse

Open
#163 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
3.4k
Forks
137
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'll start off by saying thank you for this fantastic library! It's considerably sped up development time and just feels clean.

I'm currently trying to think of the best way to handle oAuth token expiration and how to transparently use the refresh token to grab a new oAuth access token.

I currently handle unauthorised requests in handleResponse - if the request is unauthorised it'll redirect to the login page. However, now I would like to handle using the refresh token token. I currently store the access token and refresh token in sessionStorage.

One idea I had was to potentially make a request from handleResponse; however, this didn't seem too clean (and as far as I can see it doesn't have access to do this)

Any ideas/assistance would be really appreciated.

Thank you!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.