Middleware Issue on our Nextjs project
We are facing an issue on our existing middleware setup on our nextjs project, we use to check if a user is authenticated before using this code:
but now after upgrading convex auth from 0.0.74 to 0.0.80 we are getting this error:
Middleware.ts file code
Error:
can anyone help me fix this issue.
2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
There are too many things called
convexAuth
-- this is saying that your convex/auth.ts
file needs to be changed to look like export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth(...
Because Next.js middleware now expects to call an isAuthenticated
query exported from convex/auth.ts