Hmza
Hmza7mo ago

if i want to load data from a convex

if i want to load data from a convex query in nextjs middleware i just need to use fetchQuery() instead?
5 Replies
Hmza
HmzaOP7mo ago
not working though. when i use this in const currentSession = await fetchQuery(api.authFunctions.currentSession); in middleware it returns null. but in sign-in page lets say, it does shows the session
Michal Srb
Michal Srb7mo ago
You need to pass in the token, see docs
Hmza
HmzaOP7mo ago
shit. sorry. let me check again
Michal Srb
Michal Srb7mo ago
(This is supported for Clerk / Auth0 atm)
Hmza
HmzaOP7mo ago
yeah so i'm using convex auth right now. is there a way to get the token ? or is it not possible yet sorry i'm a bad reader when i wake up

Did you find this page helpful?