Back

Manually send OTP

  • 0
  • Self Hosted
  • Functions
rohan
26 Oct, 2023, 17:09

Hi, How to manually send Login OTP using functions

TL;DR
The user wants to send customized OTP content for each project using the msg91 API. They ask if it can trigger a function on phone authentication and if it will send the required data. They also inquire about fetching the OTP from a function and using a WhatsApp provider to send OTP. There is a suggestion about adding a WhatsApp provider. The user wants to send OTP via WhatsApp using their custom endpoints. The solution offered is to call the create phone session API to send the token for Appwrite's phone authentication. If the user wants to implement it themselves, they would need to create the session and provide it to the user.
Drake
26 Oct, 2023, 17:41

if you're asking about how to send the token for Appwrite's phone auth, then you can just call the create phone session api.

if you're asking about not doing that, you would implement all that yourself...however the big challenge you'll have is how to create the session and provide that to the user... 🧐

rohan
26 Oct, 2023, 17:52

i want to send otp via whatsapp using my custom end points

rohan
26 Oct, 2023, 17:52

but i see there is no option other than the providers given by appwrite

Drake
26 Oct, 2023, 18:01

if you want users to be able to create a phone session using whats app, the best thing to do is to add a whatsapp provider...there's actually an old PR for adding this...

rohan
26 Oct, 2023, 18:02

@Steven is there any way to fetch the otp from a fuction? like a database call or any as such?

Drake
26 Oct, 2023, 18:04

you could try to have a function that triggers on the api call

rohan
26 Oct, 2023, 18:06

but can it trigger a function on phone auth? and will it send the required data?

Drake
26 Oct, 2023, 18:09

try it. if the function isn't triggering, create a github issue

rohan
26 Oct, 2023, 18:10

@Steven also im using msg91 .. but i want to send customised content otp per project... that is different template id per project

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