© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
1 reply
ICA_PICA

@supabase/ssr: (NextJS) Invalid Refresh Token: Session Expired (someone please assist)

If anyone is willing to help me out with this error I keep getting in the Vercel logs, I'd be extremely thankful.
I've been trying to solve this one for about a month now, and it didn't get me anywhere.
I use NextJS and I only use server client for auth and middleware to update sessions with
getUser
getUser
but I also use
getSession
getSession
within the middleware since that allows me access to the JWT where the
user_role
user_role
is stored. The issue could possibly be that I am also using the
getUser
getUser
within Server Components. But I don't really know.

I have my entire code in a gist here: https://gist.github.com/ivanbogdan-git/3e7be53dbd0a1d07262b937cb5708d34

I've tried GitHub, Reddit, and it didn't get me nowhere. Please plase help.
Gist
gist:3e7be53dbd0a1d07262b937cb5708d34
GitHub Gist: instantly share code, notes, and snippets.
gist:3e7be53dbd0a1d07262b937cb5708d34
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

Invalid Refresh Token: Already Used: SSR NextJS
SupabaseSSupabase / help-and-questions
14mo ago
Invalid Refresh Token
SupabaseSSupabase / help-and-questions
4y ago
Invalid Refresh Token: Refresh Token Not found
SupabaseSSupabase / help-and-questions
2y ago
session with @supabase/ssr
SupabaseSSupabase / help-and-questions
3y ago