Phone provider with Twilio example is returning an error when executing createAccount() method
Hi there,
I am trying to implement the Twilio phone provider example as showed here: https://github.com/get-convex/convex-auth-example/blob/main/convex/otp/TwilioOTP.ts
The phone number and later the code (OTP) verification is working without an issue, but when it comes to creating an account I am receiving the following error from Convex:
ERROR [CONVEX A(auth:signIn)] [Request ID: 8f51f3d87aadd853] Server Error
Uncaught Error: Uncaught Error: Uncaught Error: Index authAccounts.providerAndAccountId not found.
at handler (../../node_modules/@convex-dev/auth/dist/server/implementation.js:597:54)
at async createAccount (../../node_modules/@convex-dev/auth/dist/server/implementation.js:981:14)
at async handler (../../convex/otp/TwilioSDK.ts:29:16)
at async authorize [as authorize] (../../convex/otp/TwilioVerify.ts:22:8)
at async signInImpl (../../node_modules/@convex-dev/auth/dist/server/implementation.js:1149:23)
at async handler (../../node_modules/@convex-dev/auth/dist/server/implementation.js:425:20)
ERROR [Error: [CONVEX A(auth:signIn)] [Request ID: 8f51f3d87aadd853] Server Error
Uncaught Error: Uncaught Error: Uncaught Error: Index authAccounts.providerAndAccountId not found.
at handler (../../node_modules/@convex-dev/auth/dist/server/implementation.js:597:54)
at async createAccount (../../node_modules/@convex-dev/auth/dist/server/implementation.js:981:14)
at async handler (../../convex/otp/TwilioSDK.ts:29:16)
at async authorize [as authorize] (../../convex/otp/TwilioVerify.ts:22:8)
at async signInImpl (../../node_modules/@convex-dev/auth/dist/server/implementation.js:1149:23)
at async handler (../../node_modules/@convex-dev/auth/dist/server/implementation.js:425:20)
Called by client]
Does anybody have any experience with that and can help me somehow?
Thank you.
GitHub
convex-auth-example/convex/otp/TwilioOTP.ts at main ยท get-convex/co...
Convex Auth example repo. Contribute to get-convex/convex-auth-example development by creating an account on GitHub.
2 Replies
Can you double check that you've done this step in the set up? https://labs.convex.dev/auth/setup#add-authentication-tables-to-your-schema
Set Up Convex Auth - Convex Auth
Authentication library for your Convex backend
Thank you for the quick reply! Yes, that ws the issue, I had no schemas defined, ergo also no Auth tables available. It worked after that. Perfect! Thanks ๐