🍿 Stop Putting Auth in Middleware (and a surprise for you)


Hey Reader,

As promised, the Modern Full Stack Next.js Course is 40% off for the next 48 hours. If you're interested in levelling up your Next.js skills and ship 7+ Production-ready apps, use code "FLASH40" to grab the discount.

Count down to 2026-03-15T15:00:00.000Z​

so, What is Modern Full Stack Next.js Course?

​Modern Full Stack Next.js Course is a comprehensive, hands-on, interactive Next.js course designed to help you build and ship production-ready applications with modern best practices.

You’ll learn by doing through structured exercises, interactive demos, and 7+ real-world projects, covering everything from Next.js fundamentals to advanced topics like Server Components vs Client Components, caching, Server Actions, and deployment.

If you want to level up your Next.js skills and ship 7+ production-ready apps, use code "FLASH40" to grab the discount:
​

​
🍿 Weekly Snack: Stop putting Auth in Middleware

Middleware got renamed to Proxy in Next.js 16. Same functionality. Better name.

What is Proxy? Every request to your app has to go somewhere - a page, an API route, a file. Proxy gets to look at it first and decide what happens: send the user somewhere else, serve different content silently, or just let it through as-is.

Think of it as a traffic controller 🚦 sitting in front of your routes.

So, why you should stop putting auth in Proxy?

It feels like the perfect place but it isn't. Developers started throwing auth and session logic into middleware. That's not what it's for. "Middleware" kept getting confused with Express middleware too. That's exactly why it got renamed.

So where should you do it? Next to the data access layer i.e. fetching the data or where you need it.

Here's how proxy should be,

But there is another very important reason too

In March 2025, a CVE disclosed that Next.js uses an internal header called x-middleware-subrequest to prevent infinite loops. The problem? An attacker could spoof it and Next.js would skip all middleware checks entirely.

That's also why auth should NOT live in Proxy.

πŸ’‘ Takeaway

β†’ Use Proxy for redirects, rewrites, headers, A/B tests

β†’ Move auth into Server Components, Route Handlers, or Server Actions

πŸš€ Latest Frontend News

LIBRARY UPDATES

​Astro 6.0 is out and it basically catching up to Next.js's feature set (native font optimization, route caching, CSP, better SSR) but users have to explicitly choose which ones to enable

A React framework built for Cloudflare is now out of beta and full stable

​TanStack AI Open Router lets you hit GPT-5, Claude, Gemini, Llama, DeepSeek and more, all through one API

A new CLI tool by TanStack that helps library maintainers generate and ship Agent Skills alongside their npm packages

​shadcn/cli v4 is out - this is a HUGE update. Previously, changing fonts, colors, icons, or component library meant manually updating multiple files. Now a single --preset flag with a short string like AKG33FG restyles your entire design system.

TypeScript 6.0 is now available as a release candidate, go try it (with caution) before it officially ships

​Prisma ORM 7.5.0 just shipped with Nested transaction rollbacks via save-points, Run raw SQL in Studio and a lot more.

GREAT READ

​Slim lets you share your local dev server with a public URL, no tunneling headaches

How does a Fast Rust bundler for JS/TS handle chunking and dependency graphs for faster builds and bundles

​Next.js installs will soon include version-matched docs, giving agents context on new and recently updated APIs.

AI

Claude Code just killed a bunch of startups as it now has built-in code review - it can analyze pull requests, flag issues, and suggest improvements before you merge

Ask Side Questions while your main task keeps running in Claude Code?, /a new tool by claude code​

Remember the hype around Cloudflare's Next.js alternative? Well, there are multiple critical security flaws​


πŸ™ Your Feedback helps shape the newsletter

Make sure to keep sharing your feedback by clicking one of the links below. I'm listening πŸ‘€ .
​​
​
πŸ”₯ Love it!​

β€‹πŸ˜ It’s okay​

β€‹πŸ‘Ž Not good​

If you’ve published a blog post or shipped something, feel free to reply to this email and it comes straight to my inbox. I’m always looking for great community work to consider featuring.

All past newsletters can be found here. You can email me at me@kulkarniankita.com to advertise/sponsor the newsletter.

For those curious, I write all my emails using Convertkit.

If you’d like to keep learning, you can grab yourself a copy of the course:

β†’ Buy a copy of The Modern Full Stack Next.js Course πŸ’–

Use code: FLASH40 for 40% off or use the ppp code from the banner on the website, whatever is cheaper.

See you next week!

Ankita Kulkarni

Join 9200+ subscribers reading by weekly personalized Newsletter that helps developers level up their skills through weekly Frontend and Leadership Snacks. You get a deep dive into a Tech topic, Actionable tips to excel in your career and a toolbox!

Read more from Ankita Kulkarni
You’re Suspending the Wrong Component

Hey Reader, There are thousands of you going through Modern Full Stack Next.js Course so wanted to be grateful here for your support. Just as a thank you, there is something big dropping for you. It will only last 24 hours ⏰ so keep an eye out for my email next week. Let's dive in! PRESENTED BY CLERK Instead of your coding agent guessing how auth works, you can now install specialized Clerk knowledge directly into it. Introducing Clerk Skills One simple command $ npx skills add clerk/skills...

Next.js bundle analyzer

Hey Reader, This week, we're putting your Next.js app under the microscope, what's slowing it down? This along with the latest news, can AI really debug complex React/Next.js bugs? How OpenClaw and Anthropic are enabling AI collaboration, 3 New Coding Models dropped and more. Let's dive in! 🍿 Our Weekly Snack: What's Really Slowing Down Your Next.js App? Have you ever wondered why your Next.js app feels sluggish or takes forever to load? 🐌 The new experimental Bundle Analyzer in Next.js 16.1...

git worktree

Hey Reader, A lot of you have been asking me how I’m able to stay so productive and get a lot of work done so I finally broke down my exact workflow and setup in a short video. 🍿 Our Weekly Snack: Run Multi Agents stress free with Claude Code Git work trees let you check out multiple branches at the same time each in its own folder all backed by the same repo. Instead of one working directory and constant branch switching, you get parallel workspaces. Each work tree has its own isolated...