felix
felix
NNuxt
Created by felix on 10/14/2024 in #❓・help
Auth cookie being refreshed during SSR
Hi everyone! Im running into an issue where Cookies that are refreshed during SSR isnt used in subsequent SSR fetch requests. Our setup is a bit weird but we have a Nuxt frontend that is being SSR'd. All requests are passed through a useFetch wrapped to set a refreshToken timeout. We have a Nitro instance running that proxy all our request to our other Docker C# API. We have solved the issue where the cookie is refreshed when the server is making a SSR fetch, we just pass it to the frontend with the useCookie composable, the issue we are running into now is that after the first SSR fetch request to our C# API refreshes the token, we update the client cookie with useCookie but subsequent request done that SSR request arent using the updated token but instead using the old invalidated token. We could solve this by making the old token valid some time after it gets refreshed but I wanted to check if anyone here have any better ideas. Thanks!
6 replies