convex-auth template error getAuthUserId
When I install the Convex Auth template https://www.convex.dev/templates/convex-auth
with
npm create convex -- -t get-convex/convex-auth-example
, follow the setup and then do npx convex dev
I get the error:
Convex Auth
Convex Auth is a library for implementing authentication directly within your Convex backend. This allows you to authenticate users without needing an authentication service or even a hosting server. Your application can be a React web app served from a CDN or a React Native mobile app.
3 Replies
Sounds like we have some version mismatches -- thanks for pointing it out. Can you try
npm install @convex-dev/auth@latest
?I changed
getAuthUserId
to ctx.auth.getUserIdentity();
this worksI am also little bit confused, because here https://www.convex.dev/templates/convex-auth you say its next.js but when i run the template it uses vite
Convex Auth
Convex Auth is a library for implementing authentication directly within your Convex backend. This allows you to authenticate users without needing an authentication service or even a hosting server. Your application can be a React web app served from a CDN or a React Native mobile app.