What token to pass when doing fetchQuery on the client
Maybe this is a really stupid question, but when I do await fetchQuery on a client function (e.g.
.ts
file marked as "use client"), I can't get a token from getAuthToken (for server auth) and getUserIdentity returns null...
Any ideas?3 Replies
is my solution to manually pass around a jwt token from components to client helper functions?
Any reason you can't do something like
given you're doing this only on the client?
the function that does the query is not inside a react component, don't know if that makes sense. Currently I'm doing
Then from a react component:
There's probably much cleaner ways of handling this, but if I put the convex hook inside clientApp I get: