Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseβ€’4y agoβ€’
17 replies
jamielarkspur1995

Supabase Auth with Next.js

I recently set up my app using this guide:

https://supabase.com/docs/reference/auth-helpers/next-js

I'm redirecting the user to a
/login
/login
page if they end up on a protected route using
withMiddlewareAuth
withMiddlewareAuth


For some reason, and I've only noticed this today and am trying to figure out what I did, even after the user logs in, you still get redirected to
/login
/login
, unless you do a refresh of the page. Is this expected behavior? What could be causing it? thanks!
Supabase Auth with Next.js | Supabase
This submodule provides convenience helpers for implementing user authentication in Next.js applications.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Supabase auth next.js
SupabaseSSupabase / help-and-questions
4y ago
Supabase with Next.js 13
SupabaseSSupabase / help-and-questions
4y ago
Can't sign in using Supabase Auth with Next.js
SupabaseSSupabase / help-and-questions
14mo ago
Auth error with Next.js example
SupabaseSSupabase / help-and-questions
4y ago