@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
but I also use getSession
within the middleware since that allows me access to the JWT where the user_role
is stored. The issue could possibly be that I am also using the 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.1 Reply
You need to elaborate on the error, how often it fires, when it fires etc, you cannot share a fraction of your logic and expect others to debug it for you.
I'd be happy to help but i will need a step by step of user interactions that trigger it. You also didnt share the updateSession file.
By the looks of it you're simply trying to refresh the token on non-signed in users.
tsx formatting would also be nice 😅