I worked on a Next.js app that connects to a NestJS backend for authentication using an access token and a refresh token stored as HttpOnly Cookie. The main challenge is that cookies are read-only in server components; they can only be used in server...

Markdown supported · ⌘↵ to post
Fire 🔥, even after these years, your approach still works (with some changes oc). Your explanation is so simple and clear 🎯
Hoàng Nguyễn Huy
Thanks for sharing. But I have a question? For example, I have a getting data function in a server component (await get...), so when I request from browser and access token is expired, how can I refresh token. It's mean, in this case, we do not use the server action or route handle