Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new SMS provider Textlocal #342

Merged
merged 7 commits into from
Jan 16, 2022
Merged

Add new SMS provider Textlocal #342

merged 7 commits into from
Jan 16, 2022

Conversation

devkiran
Copy link
Contributor

What kind of change does this PR introduce?

Introduce new SMS provider Textlocal (India)

What is the new behavior?

Change the following env variables, users will be able to send SMS with Textlocal SMS API.

GOTRUE_SMS_TEXTLOCAL_API_KEY=""
GOTRUE_SMS_TEXTLOCAL_SENDER=""

Additional context

Implementation displays the message from Textlocal API if an error occurs.

Screenshot 2022-01-14 at 12 57 45 PM

Copy link
Member

@kangmingtay kangmingtay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @devkiran & @bhanuc, thanks for getting started with adding this provider and helping us test this out (esp since the supabase team can't test it because we can't create a textlocal account).

Just wanted to check on the phone number format coming from India - we currently assume that all sms providers follow the E.164 format. The other sms providers like twilio, messagebird and vonage all support this format and i was wondering if textlocal supports this format since they don't operate internationally?

api/sms_provider/textlocal.go Outdated Show resolved Hide resolved
@devkiran
Copy link
Contributor Author

@kangmingtay I have checked their doc, it says mobile numbers in international format (i.e. 918123456789). Here is the send SMS API reference https://api.textlocal.in/docs/sendsms

@kangmingtay
Copy link
Member

@devkiran thanks again for iterating on this so quickly! 💯

@kangmingtay kangmingtay merged commit bf35829 into supabase:master Jan 16, 2022
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.3.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@bharath2612
Copy link

Hey kiran, we are trying to integrate textlocal with supabase for phone otp verification. I have added the api key from textlocal in supabase provider.

This is the error we are getting: AuthException(message: Error sending sms otp: textlocal error: Internal Error, statusCode: 400)

can you guide us here?

@bharath2612
Copy link

Hey @devkiran

@kangmingtay
Copy link
Member

hey @bharath2612, can you please contact us at support (https://app.supabase.com/support/new) so we can look into your project? you may also want to check your project's auth logs at https://app.supabase.com/project/_/logs/auth-logs which may provide more details on the error you've observed.

@bharath2612
Copy link

Hey @kangmingtay, thank you for the revert, we have done some tests and found out that we are receiving the error whenever we use the " {{ .Code }} " in the message. If we replace the .code variable with a 6 digit code, it is sending the otp message succesfully from textlocal.

For example,

What worked for us: "Use OTP 123123 to log into your propzing account. Do not share this OTP."

but when we use this: "use OTP {{ .Code }} to log into your Propzing account. Do not share this OTP." , It throws an error :
AuthException(message: Error sending sms otp: textlocal error: Internal Error, statusCode: 400)

Can you guide us here as to where we are going wrong?

@Sathish-Kumar-A
Copy link

Hey @kangmingtay, thank you for the revert, we have done some tests and found out that we are receiving the error whenever we use the " {{ .Code }} " in the message. If we replace the .code variable with a 6 digit code, it is sending the otp message succesfully from textlocal.

For example,

What worked for us: "Use OTP 123123 to log into your propzing account. Do not share this OTP."

but when we use this: "use OTP {{ .Code }} to log into your Propzing account. Do not share this OTP." , It throws an error : AuthException(message: Error sending sms otp: textlocal error: Internal Error, statusCode: 400)

Can you guide us here as to where we are going wrong?

I'm also facing the same issue. got any leads to solve it @bharath2612 ?

@vasanth-ravisankar
Copy link

It seems there is another PR regarding TextLocal integration. #853. It mentions that the TextLocal endpoint has been changed and it is getting fixed through that PR. But it has been closed without any further updates. And the AuthException(message: Error sending sms otp: textlocal error: Internal Error, statusCode: 400) is still persisting with TextLocal. Is there any update on this front? @devkiran @kangmingtay

@askYourTask
Copy link

yes, i too face the same issue, it still says AuthException(message: Error sending sms otp: textlocal error: Internal Error, statusCode: 400)

@Sathish-Kumar-A
Copy link

I think the problem is due to SMS template configuration from operator in Textlocal. you have to create a customized SMS template from the operator e.g. Airtel, Vodafone (India). Then configure this template in the text local with the header ID. After this process, It may work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to add otp provider for India
6 participants