can i do auth or run a function on the server side?
hi all! i have the following code,
and i've been running into the following error when i click on "logout"
is it possible to move
api.db.username
to the server side for this component? or am i taking a wrong path? thanks!2 Replies
That function is already server-side in Convex, and that error is being thrown there. When the user clicks logout, your client is clearing the authentication state, but not stopping the request to db:username. Is that component inside a <Authenticated> tag? e.g.
<Authenticated><SideBar/></Authenticated>
? Or try doing isAuthenticated
instead of isLoading
on the skip linebingo! the isAuthenticated fixed it. thanks 🙂