getUser() in middleware #31272
Unanswered
alessiotortora
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Supabase docs gives the example to supabase.auth.getUser() in the updateSession() function in middleware. But if i check the auth logs in the dashboard. A lot of calls are made to the auth server (sometimes 1000-2000 in hour for 1 single user), should i be concerned if i get more users ?
I see a lot of people use getSession() in the next middleware to fix this. but this is not secure nor recommended.
Can somebody give a easy example of the middleware ? -> where you just protect the dashboard path. and gets redirected to the root.
Also a user can not visit /login path when already logged in.
if i have the feeling on every request the updateSession gets triggered ? but it should actually only update when the session is going expire or do i understand it wrong ?
Beta Was this translation helpful? Give feedback.
All reactions