feat Renew access tokens on 401 errors using redirects to auth endpoint #399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #350
Type: feature
Issue
Renew access tokens on 401 errors by redirecting to re-auth
Solution
Breaking changes
None
Flash of "Not Found"
If going from product grid to a product's detail page and you have an expired token, the app first shows the Not Found component based on this line of code:
https://github.com/reactioncommerce/reaction-next-starterkit/blob/558d94be01491c26c708d8dea98d6e7528a29bdb/src/pages/product.js#L93
The Not Found page is shown while the redirect is happening. Once redirect flow completes, the product component is then displayed properly. I haven't found a way to fix this.
Testing