Next.js 16 Middleware DEPRECATED - Authentication In Proxy Or Data Access Layer?

ByteGrad October 24, 2025
Video Thumbnail
ByteGrad Logo

ByteGrad

@bytegrad

About

Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship). My COMPLETE React & Next.js course is out now! Find it here: https://bytegrad.com/courses/professional-react-nextjs It's the #1 resource to master the latest React & Next.js. I'm very proud of it, my best work! Interested in sponsoring me? I love working with sponsors. Please email me here: [email protected] Note that my videos may contain mistakes. Always verify yourself that your code is safe and does what you want it to do for your specific situation. You agree by watching the videos that you are solely responsible for any mistakes in your code. This channel and all its content is owned & operated by ByteGrad Sp. z o.o. with Tax ID: PL6762676561 and KRS-number: 0001125554

Video Description

What to do with "middleware" in Next.js... 👉 Get $50 Kinde credit (sponsored): https://kinde.com/r?kinde_ref=e95bc6f8f17eda7c 👉 React & Next.js Course: https://bytegrad.com/courses/professional-react-nextjs Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship). 👉 Kinde $50 credit for auth and more https://kinde.com/r?kinde_ref=e95bc6f8f17eda7c 👉 Work with me: [email protected] 👉 React & Next.js Course: https://bytegrad.com/courses/professional-react-nextjs 👉 Professional JavaScript Course: https://bytegrad.com/courses/professional-javascript 👉 Professional CSS Course: https://bytegrad.com/courses/professional-css 👉 Web development roadmap 2024 & 2025: https://email.bytegrad.com 👉 Email newsletter (BIG update soon): https://email.bytegrad.com 👉 Discord: all my courses have a private Discord ⏱️ Timestamps: 00:00 Intro 01:12 What NOT to do in proxy 01:57 What to do in proxy 02:54 Authentication in middleware / proxy? 04:14 Major pitfall with authentication in middleware / proxy 04:35 Add auth (Kinde) 06:04 Major pitfall (continued) 11:54 Same pitfall in page server component 12:48 Data access layer (DAL) 17:46 Exception 1 21:39 Exception 2 #webdevelopment #reactjs #nextjs Note that my videos may contain mistakes. Always verify yourself that your code is safe and does what you want it to do for your specific situation. You agree by watching the videos that you are solely responsible for any mistakes in your code. This channel and all its content is owned & operated by ByteGrad Sp. z o.o. with Tax ID: PL6762676561 and KRS-number: 0001125554 . . TOP resource to LEARN AI for Developers - https://datacamp.pxf.io/RGyxrR (paid sponsorship & ByteGrad Sp. z o.o. gets commission)