muhammad_usama
TTCTheo's Typesafe Cult
•Created by muhammad_usama on 6/8/2023 in #questions
How to handle token expiration in RSC calls ?
Previously what I would do is like have axios interceptors and attach tokens in the headers and if call fails due to token expiration then catch it in interceptor. Generate a new token, store it and refetch the original request.
But how would this work in RSC. e.g While fetching data in RSC I get tokens from cookies in the server component and while fetching data it expires. I can generate a new one. I can get the data using this new token But I have to tell the client to store a new token so that it can send it the next time. I am not sure how to properly implement this.
I have a seperate backend in express
1 replies