Convex Auth Magic Link with Resend: Uncaught Error: Uncaught Error: Index users.email not found.
I'm trying to setup the new Convex Auth in with Magic Link my Nextjs app. I'm following the official tutorial and the demo app. When I call
signIn("resend", formData)
, I'm getting the error:
I must have done some error somewhere but since this is very new, I can't figure out where to look at. I'm running this on localhost.
Here is my auth.config setup:
5 Replies
What does your users table look like? Did you do step 3 here or do you have a custom one? https://labs.convex.dev/auth/setup#add-authentication-tables-to-your-schema
Set Up Convex Auth - Convex Auth
Authentication library for your Convex backend
@ian I did spread the
authTables
object. But I also already had a custom users
table which I kept. (I added missing fields though)You can either add the missing index (see the schema here, or implement a custom
createOrUpdateUser
callback to manage the account linking & creation yourself: https://labs.convex.dev/auth/advanced#controlling-account-linking-behaviorAdvanced: Details - Convex Auth
Authentication library for your Convex backend
Customizing Schema - Convex Auth
Authentication library for your Convex backend
I'd suggest implementing
createOrUpdateUser
Ok, I fixed the issue: I defined the
email
index as by_email
. I corrected it and it worked.