🚨 STOP Using Auth in Next.js Layouts

Поділитися
Вставка
  • Опубліковано 11 лют 2025
  • 🚨 STOP Using Auth in Next.js Layouts. By checking auth, you are retrieving cookies. If you do this in a Next.js layout, you make every route the layout applies to dynamic. In this short, I show a better way.
    The regex string from my Next.js middleware:
    "/((?!api|_next/static|_next/image|favicon.ico|robots.txt|$).*)"
    💖 Support me on Patreon ➜ / davegray
    👉 Checkout the Kinde Next.js docs: docs.kinde.com...
    💻 Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGra...
    🚀 Discord ➜ / discord
    👇 Follow Me On Social Media:
    GitHub: github.com/git...
    X: / yesdavidgray
    LinkedIn: / davidagray
    Blog: www.davegray.c...

КОМЕНТАРІ • 61