twilio / authy-ruby

**Deprecated** Ruby library to access the authy API
MIT License
156 stars 47 forks source link

Authy::API.register_user should handle normalized phone number #43

Closed gbudiman closed 2 years ago

gbudiman commented 5 years ago

Authy::API.register_user should intelligently handle normalized phone number, instead of requiring formatted one, separate from country code.

E.g. it should be able to handle +464790909090 without having to supply separate input of +46 and 4790909090

philnash commented 5 years ago

That is an interesting proposal. Do your users expect to fill in that detail in that format? Or do you already have their phone numbers in e164 format and you'd like to be able to send that data straight into the gem?

Would you be interested in working with me on implementing this feature?

gbudiman commented 5 years ago

@philnash TL;DR version: We'll write up a PR along with tests as soon as we have the time to (within 2 weeks).

Long version: some database enforces phone number normalization. So systems that interface with this kind of databases are required to add one more step to separate country code. It would be nicer if Twilio's Authy API supported this out of the box - unfortunately, support said "no, maybe later". We believe we can add a tiny adapter here, right before the actual HTTP POST is sent to the API endpoint.

Thanks

philnash commented 5 years ago

Sounds good to me. I look forward to your PR!

yasyf commented 5 years ago

@philnash to answer your question, we already have the numbers in e164 format. @gbudiman will work on putting that PR together!

gbudiman commented 5 years ago

@philnash PR created https://github.com/twilio/authy-ruby/pull/44 Please review and let me know. Thanks

robinske commented 4 years ago

Closed #44, but still willing to accept a PR on this if you want to add this functionality without requiring phony!

philnash commented 2 years ago

Closing this issue as we are now deprecating the library. Please see the README for more details on what to do next.