Replies: 1 comment 1 reply
-
I wonder the same thing. It seems very inefficient to use getUser() once in the middleware and once inside the server component just to retrieve the user information. I opted in for using getSession() inside the server components but as of the last update i get a warning
which is pretty annoying |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://supabase.com/docs/guides/auth/server-side/nextjs
The middleware is calling getUser() to check if someone is logged in and if not redirects them. But I'm very confused, because later in the PrivatePage example it calls getUser() again.
This seems super inefficient - why do we even need the middleware if we are having to getUser()? Is there a way to just pass the getUser object down to the page so we don't have to duplicate?
This is adding latency for every single page the app - feels there should be a proper way to do this?
Beta Was this translation helpful? Give feedback.
All reactions