Problems with refreshtoken cookie path in nextjs13...
# support-questions-legacy
s
Problems with refreshtoken cookie path in nextjs13 server side rendering I am using nextjs13 SSR and a fastapi backend. When I render something in server in nextjs I send the accestoken and everything works fine. When my accestoken is expired I call my refresh endpoint. The problem is that I don't have the refreshToken cookie because is only for /myrefreshendpoint. How can I fix it? Is any way to make this cookie available for all paths? Is that secure? Thanks for reading!
r
Hey.
See our docs for NextJS SSR
you need to send back a response to the client which tells it to call the refresh API and then reload the page
s
I have been looking at it for a while, seems like a bad solution to achieve something that could be done by changing a cookie path
How can I change the cookie path? Is that secure?
Also, as I see your solution totally breaks the SSR lifecycle because all pages are using the useEffect hook
r
Changing the refresh cookie path is a security issue.
What do you meant by breaks the SSR lifecycle? Using useEffect doesn’t break SSR
7 Views