2025-05-23
2666
#nextjs
Temitope Oyedele
103559
116
May 23, 2025 â‹… 9 min read

A crash course in Next.js middleware

Temitope Oyedele I am a web developer and technical writer. I love to write about things I've learned and experienced.

Recent posts:

Is Better Auth the key to solving authentication headaches?

Better Auth is an open-source, TypeScript-first auth library with adapters, schema generation, and a plugin system. Here’s how it works and how it stacks up to Clerk, NextAuth, and Auth0.

David Omotayo
Sep 26, 2025 â‹… 10 min read
What using a screen reader taught me about real web accessibility

What using a screen reader taught me about real web accessibility

Read one developer’s detailed account of using a screen reader to learn more about a11y and build more accessible websites.

Sebastian Weber
Sep 25, 2025 â‹… 29 min read
david turnbull claude code hacks

6 easy ways to level up Claude Code

Walk through six tips and tricks that help you level up Claude Code to move beyond simply entering prompts into a text box.

David Turnbull
Sep 24, 2025 â‹… 5 min read

Choosing the right React Router v7 mode for your project

React Router v7 is now more than routing. This guide explains its three modes—declarative, data, and framework and how to choose the right one for your app.

Amazing Enyichi Agu
Sep 23, 2025 â‹… 1 min read
View all posts

3 Replies to "A crash course in Next.js middleware"

  1. Thank you for the article.
    Would this mean that using Middleware in Next.js disables the static page generation and as a consequence every page becomes server side rendered?

  2. No, the middleware doesn’t disable the static pages but works with it by modifying or manipulating the pages by sending responses depending on the req(cookies,headers,geolocation) parameters.

  3. Thanks but is hardcoding a username and password a valid production case? I would expect in a real world to have the users and password stored in a database, which is not at the edge, limiting then the authentication use case. I’m struggling to understand this use case. Do people really do that?

Leave a Reply