StoicWanderer
StoicWanderer16mo ago

How to use isAuthenticated and Convex mutation in Next.js?

I want to finish my hackathon entry, although I didn't have time to submit anything, so, I use Auth0 in my project and i can't use useEffect because i have isAuthenticated in my navbar in 2 places to verify if the user is logged in or not, because this way when I wanto mutate the user data into my Convex database I receive 2 or 3 entries which is not what I want for ONE single user. https://github.com/andrejmoltok/oceans5/tree/main/src/pages/components
GitHub
oceans5/src/pages/components at main · andrejmoltok/oceans5
Oceans5, a WebDevCody Hackathon entry. Contribute to andrejmoltok/oceans5 development by creating an account on GitHub.
2 Replies
jamwt
jamwt16mo ago
Hi. Does your use store function check for existing entires like the example repo? See https://github.com/get-convex/convex-demos/blob/main/users-and-clerk/convex/users.ts
GitHub
convex-demos/users-and-clerk/convex/users.ts at main · get-convex/c...
Demo apps built on Convex. Contribute to get-convex/convex-demos development by creating an account on GitHub.
StoicWanderer
StoicWandererOP16mo ago
Hi @jamwt just noticed, i somehow got passed over this not realizing this is the way i have to follow. Thanks.

Did you find this page helpful?