79353039

Date: 2025-01-13 17:51:47
Score: 1
Natty:
Report link

but this is giving me an infinite loop. Even if I make it a server component it still gives me infinite loops.

You are getting an infinite loop because you need to check for the pathname.

if (!user && pathname !== '/login') {
  redirect('/login');
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: lighthaus205