Repository navigation
Replies: 1 comment 3 replies
|
Here is some very early / basic implementation of a refresh_flow with SSR: https://github.com/pA1nD/next-getSSP-example |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The picture above shows a illustratory example of a access_token and refresh_token based authentication.
Currently there seems to be an issue when the access_token has expired and the refresh route needs to be triggered.
Important to know is that (in order to make sense) the refresh_token is stored only in the client and should only be available at /api/refresh . So it is only sent when a refresh is required.
Traditionally libraries like axios provie a solution via intercept, where it is possible to catch an error, trigger the token refresh and execute the request again.
It seems to be impossible to intercept the answer of getServerSideProps, and directly cause a refresh on the client.
Am I wrong? Did anyone solve this?
All reactions