getAuthUserId with tanstack userId null
When using using useQuery from @tanstack/react-query, getAuthUserId always returning null so the current userId is null
6 Replies
How are you hooking up auth? It's possible but it's extra work. Something like this? https://github.com/get-convex/convex-react-query?tab=readme-ov-file#authentication-example-todo
this in my layout.tsx
mutations are working fine it's just queries
Oh with Nextjs, interesting. Are these queries being kicked of from the server or the client?
From the client so when I do this
UserId in getById is there but doing this
For some reason userId is null
This needs work, hence the TODO at https://github.com/get-convex/convex-react-query?tab=readme-ov-file#authentication-example-todo — everything should be possible now but as I roll back onto this project I'll get an example
@jeremienegie If you open up the browser devtools and look at the WebSocket connection, is auth ever being sent over?
You may have two separate convex clients depending on how you've set things up
Is this code you can share? Or DM?
If you've got a smaller reproduction you can open an issue at https://github.com/get-convex/convex-react-query
I haven't tried an example yet so I don't know if there's something that doesn't work yet or if it's misconfigured, should have some progress on a real example by next week.
I shared my layout.ts above I don't think I'm running two convex client but ey I'm just learning convex I don't understand why one working anf the other no my mutations with tanstack is running perfectly with the set up I have
Okay thank you.
Hi @ballingt I wanted to ask if you had a look at the problem