While working on the Field Scout Report project, I ran into this problem where none of my requests were going through in production despite working perfectly fine locally. The network tab showed that every API request redirected to /auth/signin which was odd since I was signed in. This would be expected behavior if I was signed out. After consulting copilot and not having any luck, I peroused some Google results and stumbled across some developers having similar issues at the time that Next.js was updated to enable prefetch by default for the <Link> component. I immediately went back to https://scout-report.vercel.app/ and opened the cookies tab in dev tools. After signing in, Supabase creates two cookies. When I opened the hamburger menu that contained the signout link, boom! Cookies gone. Issue confirmed. The signout link is being prefetched.
It was quite embarrassing once I realized what was happening because I had ran into this same issue when working on the Wallin Farms site a couple of years ago. Fool me once, shame on you Next.js. Fool me twice, shame on me. Fool me three times, well let's just hope this doesn't ever happen a third time. The odd part is that the cookies weren't deleted on localhost so I didn't realize there was an issue until I got to production. So it makes me wonder if prefetch is disabled locally...