My SaaS platform is live on FastAPI (Python) and Next.js, with OpenAI API powering several features. Everything works except the most important part: users cannot log in consistently. I’ve traced the problem to the hand-off between frontend and backend—tokens leave the browser but something breaks before FastAPI accepts them. We use JWT for all auth flows, so I need someone who knows that pattern inside out and can spot subtle communication glitches fast. Your job is to dive into the codebase, reproduce the failure, isolate the root cause, and ship a clean, secure fix. Success means a new user can sign up, receive their JWT, refresh it on schedule, and hit protected endpoints without a single 401. Deliverables • Detailed diagnosis of the communication fault between Next.js and FastAPI • Patch or pull request that resolves the bug and hardens the JWT flow • Brief write-up of changes so I can follow the logic and avoid regressions in future If you’ve untangled JWT headaches in a mixed FastAPI/React stack before, this should be quick work—let’s get my users logging in smoothly again.