79357221

Date: 2025-01-15 06:30:04
Score: 2.5
Natty:
Report link

I did a lot of research. The problem is that you can't update the cookie from the server component. I am leaving a video link; he explained very nicely why you can't set a cookie from the server component. As a solution, I have used Redis to store the refresh and access token. If you use Redis, there is another problem. Radis doesn't support edge runtime. So you can't access directly to redis functions from middleware. Make a nextjs API like is-logged-in, then use it from middleware by fetch.

Here is the link.

Reasons:
  • Blacklisted phrase (1): video link
  • Blacklisted phrase (1): Here is the link
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Tofazzal haque