Back

Testing Phone Authentication, Verification, and LogIn Locally with Appwrite & Twilio

  • 0
  • Self Hosted
  • Auth
  • Messaging
jadie6133
11 Aug, 2024, 07:42

Hello all!

For the first time, I'm trying to implement creating, verifying, and login via phone using Appwrite. So far I was able to successfully implemented and tested /signup endpoint. However, I cannot figure out how to make my /verify-phone endpoint to simulate otp. I'm continuously getting : Invalid token passed in the request.

This is my signup, verify-phone, login endpoints in my server.js (node.js). I'm testing in my local.

I've correctly added these to my local appwrite's env. _APP_SMS_PROVIDER=sms://[ACCOUNT_SID]:[AUTH_TOKEN]@twilio
_APP_SMS_FROM=[TWILIO_PHONE_NUMBER]

Can someone please help me why verification step is failing though signup is working?

TL;DR
Developers are having trouble simulating OTP for the /verify-phone endpoint in a local environment using Appwrite and Twilio. The error message "Invalid token passed in the request" keeps showing up, even though the signup endpoint is working fine. The environment variables seem to be correctly set up.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more