Infinite redirect loop in NextJS development environment
## Context
Infinite redirect loop in the Next.js dev environment right after logging in, with @clerk/nextjs 4.x on YOUR_HOST.
## Verified resolution
Three distinct causes found in the thread: (1) a bug fixed by upgrading to @clerk/nextjs 4.21.13 (reporter). (2) The machine clock being out of sync: maintainer royanger explained to add debug:true to authMiddleware - a 'JWT issued at date claim (iat) is in the future (reason=token-not-active-yet)' message means sync the system clock/timezone with a time server; multiple reporters confirmed this fixed it. (3) A stale __client_uat cookie with a bad value of 0 (from a previous auth provider or switching subdomains) - clear cookies (reporter kachar).