ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข7mo agoโ€ข
1 reply
riccardolardi

Nextjs Pages Router & @supabase/ssr: how to get session in middleware

We're on Nextjs Pages Router but recently upgraded from auth-helpers to @supabase/ssr. We don't seem to be able to get the user session in middleware anymore and the docs don't show which client to use in middleware: https://supabase.com/docs/guides/auth/server-side/nextjs?queryGroups=router&router=pages

Is it not possible at all? Should we protect pages on each pages level instead?
Setting up Server-Side Auth for Next.js | Supabase Docs
Setting up Server-Side Auth for Next.js | Supabase Docs
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/ssr signout nextjs app-router
SupabaseSSupabase / help-and-questions
3y ago
session with @supabase/ssr
SupabaseSSupabase / help-and-questions
3y ago
Supabase SSR + Middleware + HttpOnly Cookies?
SupabaseSSupabase / help-and-questions
5mo ago
nextjs + supabase auth, how to persist user session?
SupabaseSSupabase / help-and-questions
4y ago