query() Not Authenticated Error
Good Afternoon,
i'm a bit new to convex
I currently have it setup with clerk
i have created the following query
I'm then calling the following on my page on load here
However when I refresh the page i get this error. When i use a router.push() seems to work find but if i go to the link directly or refresh the page i get this error.
However in my query if i don't throw an error and just return a null it ends up working but seems to not be authenticated for a short while until it does
(image attached)

3 Replies
Welcome! You can pass the string
'skip'
as a second argument to useQuery()
until isAuthenticated
is true in the client to address this.
(I think undefined will work in that ternary, if not you can use an empty object)you can also use
<Authenticated><AuthenticatedDashboard /></Authenticated>
to wrap a component that does queries which must be authenticated (put the useQuery
in AuthenticatedDashboard
)ahhh thanks! i'll give it a shot
appreciate your assistance!
looks like that did it, thanks a lot!