https://supertokens.com/ logo
#support-questions
Title
# support-questions
y

yzs

07/26/2022, 7:05 AM
hi! i need help with implementing my country's OTP service phone sign-in. im having a hard time figuring out which part i should override to integrate with my country's OTP service
r

rp

07/26/2022, 7:06 AM
Hey! You can provide the
sendSMS
override function to do this: https://supertokens.com/docs/thirdpartypasswordless/sms-delivery/custom-method
(i assume that you are using thirdpartypasswordless recipe
y

yzs

07/26/2022, 7:07 AM
thanks for quick response i am using just Passwordless recipe
r

rp

07/26/2022, 7:08 AM
y

yzs

07/26/2022, 7:09 AM
and i'm trying to implement phone + password recipe (i think it's new, i haven't seen it before)
thanks, i'll take a look
r

rp

07/26/2022, 7:09 AM
Yea. That is new, but the phone + password recipe requires a fair bit of customisation.. so feel free to ask questions here.
y

yzs

07/26/2022, 7:16 AM
i thought that it should override
EMAIL_VERIFICATION
in
emailDelivery
because in the guide there is override for
PASSWORD_RESET
https://supertokens.com/docs/phonepassword/backend/email-password-customisation#change-reset-password-logic
r

rp

07/26/2022, 7:17 AM
This is for the phone number + password login or passwordless login? Im confused.
y

yzs

07/26/2022, 7:21 AM
waaaait, should i have followed only 1 option? EmailPassword | Session | Passwordless ?
r

rp

07/26/2022, 7:21 AM
yea i mean really depends on what login you want. Do you just want phone number + OTP login?
Or something else?
y

yzs

07/26/2022, 7:22 AM
i want to have phone+password, and to have users to verify their phone numbers via OTP sms
r

rp

07/26/2022, 7:22 AM
got it.
So for the send SMS part, you would need to override the sendSms function in the passwordless.init function
as shown in the link i had sent.
y

yzs

07/26/2022, 7:30 AM
😅 how can i clear users database?
r

rp

07/26/2022, 7:31 AM
for the managed service?
or self hosted?
y

yzs

07/26/2022, 7:31 AM
self hosted via docker compose
r

rp

07/26/2022, 7:32 AM
Right, you can truncate all the tables in your db, and then restart the core.
y

yzs

07/26/2022, 7:39 AM
Passwordless sendSms isn't called ever my supertokens.init looks basically the same as this https://github.com/supertokens/supertokens-auth-react/blob/master/examples/with-phone-password/api-server/index.ts
r

rp

07/26/2022, 7:40 AM
Can you enable debug logs and show the output of that?
And also how have you added the sendSms callback?
y

yzs

07/26/2022, 8:26 AM
sorry, i was on a lunch break i think the problem was with nextjs' cache 😅 everything works, now i gotta deal with my sms service provider 😵 thanks lot
r

rp

07/26/2022, 8:26 AM
ah right! We do have an SMS sending service which you can use if you like.