-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear access token on expiration or auth error #105
Clear access token on expiration or auth error #105
Conversation
… no viewer data from API
AP-3631 Log user out when API token expires
Let's do the equivalent of AP-3255 in the VT addon. We can address AP-3254 later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good although I have some questions. How to QA this?
@tmeasday I just manually messed up (edited) my JWT in localStorage to make it invalid. |
Nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, works well
c6177ba
to
1f9f4b0
Compare
Clears the access token from memory and localStorage when either the token expires or the API returns either an auth error or no
viewer
data.I've updated our setup to use URQL's
authExchange
rather than our own custom header injection. This makes it a little more "intelligent" about not sending a request if we already know it will fail. It also is able to automatically retry a request after refreshing the token (e.g. using a refreshToken) but we don't have that capability yet.📦 Published PR as canary version:
0.0.88--canary.105.7ed4611.0
✨ Test out this PR locally via:
npm install @chromaui/addon-visual-tests@0.0.88--canary.105.7ed4611.0 # or yarn add @chromaui/addon-visual-tests@0.0.88--canary.105.7ed4611.0