ibrahimyaacob
ibrahimyaacob6mo ago

Convex Auth on Server Component

after sign up. this code below in server component,
const currentUser = await fetchQuery(api.getUser.currentUser);
console.log({ currentUser });
const currentUser = await fetchQuery(api.getUser.currentUser);
console.log({ currentUser });
it returns null. How do i get the user data on server component. Please help me!
8 Replies
Michal Srb
Michal Srb5mo ago
Still working on support, tracking issue: https://github.com/get-convex/convex-auth/issues/6
GitHub
Support Next.js · Issue #6 · get-convex/convex-auth
Needs middleware and likely different provider or provider props (especially to initialize the provider from the server)
ibrahimyaacob
ibrahimyaacobOP5mo ago
ah thanks, any eta for this ? I've just started a new project for a 2 week hackathon and wonder if i should switch
Michal Srb
Michal Srb5mo ago
It should be out soon, I'd avoid handling SSR for the time being in your project.
ibrahimyaacob
ibrahimyaacobOP5mo ago
Thank you. Lemme know once its ready !
Devben
Devben5mo ago
is it ready yet
Oren
Oren5mo ago
this doesn't work on client component with useQuery either rendering convex not usable...
Michal Srb
Michal Srb5mo ago
Yep, it's ready and out. Please create a new thread with details of what's not working for you, thanks!
Devben
Devben5mo ago
Thank you michal I appreciate your hard work and am very happy

Did you find this page helpful?