Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Next.js + NextAuth protect all routes - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
•
4y ago
•
7 replies
.vithis
Next.js + NextAuth protect all routes
I want my users to be redirected to NextAuth login page if they try to access any routes in my Next app
.
I tried adding middleware
export { default } from "next-auth/middleware"
export { default } from "next-auth/middleware"
But this doesn
't really work because I get redirected to login page even after I log in
Theo's Typesafe Cult
Join
26,131
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Next.js middleware with NextAuth server session?
TTC
Theo's Typesafe Cult / questions
4y ago
Next.js state management and dynamic routes
TTC
Theo's Typesafe Cult / questions
3y ago
Next App Router, All Routes Returning 404
TTC
Theo's Typesafe Cult / questions
3y ago