-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
[ Feat ]: Phone Support #65
Conversation
Hi guys, Submitting a draft of the proposed model changes. This is a pretty simple idea that does not break anything, but adds an additional property for the phone number support. Please give your thoughts on the go-ahead of full implementation. |
Hello @shawnmclean! Will share my thoughts after checking the implementation, but overall I would let @mw10013 take the final decision as he understands the whole authentication strategy better than me at this point. Thank you for the PR! |
Checked the implementation @shawnmclean, looks good to me. Any way we could have a phone number validator and the tests for the implementation? For me, this could be a merge if we are able to ensure:
Line 239 in d98d89f
Line 312 in d98d89f
|
@shawnmclean: Thanks for the PR! I apologize for being a little late to the discussion. Can you outline your use case for this so I have a better understanding. |
@mw10013 Thanks for that clarity. The intention is to add support to authenticate phone numbers, similar to emails. The change is to make accepting emails and phone numbers optional. To make the change unbreaking, if both are passed in, it will prioritize sending the TOTP to the email. If no email, it will use the phone to authenticate. The usage of which one to pass in, is up to how the consumer of the lib uses it, and how their UI is structured. Then how they store the identifiers, ie. multiple emails/phone numbers per account. The change is to add an additional use case, so the lib now becomes:
My question would be these: What happens if the user passes in both email and phone? From my analysis of the code, it may be easy to allow only 1. |
Allowing only one will be our best move here, either We will need to document all this by providing the user a few options they could leverage:
As I mentioned before, this looks good to me, but we'll need to pass these checks in order to merge it:
Optional: Creating a new template that could implement these changes in order to make it easy for the user to get started with it (Starter Template could be used for this). I think having this option for the strategy will not cause anything harmful and could simply improve it and also avoid future requests as there have been a few already on the same topic. A question:
|
@shawnmclean: Thanks for clarifying. If I understand correctly, you are not trying to authenticate an email and phone number at the same time. And also not trying to authenticate an email with a phone number or vice-versa. You seem to want to authenticate either an email or a phone number. Taking a step back, I'm wondering if you were able to authenticate a phone number alone using If that's the case, then I wonder if you are able to run two instances to I'd probably lean more toward making Adding on another specialized string such as phone seems to lead to someone else wanting a different specialized string and so on. If |
@mw10013 I was also leaning toward just validating a string. for separation of concerns, I think phone and email (and whatsapp) should have separate config. if we can use different startegies this might make it simpler. just need to remove the "email" word from the config. how do we make remix auth use one startegy or the other? |
@chiptus: Apologies for delayed response. It would be helpful if you could share your specific use case, if you have one. For instance, I'm trying to authenticate email and phone. I tried running 2 instances of Have you been able to use I believe |
hey, currently we have only whatsapp verification. this is the code I use:
I would like to add also email, and Product also wants to replace whatsapp with regular sms |
@chiptus: Thanks for sharing some code. It really helps to make things concrete.
/**
Wondering if you can have 1 instance for email and the other for regular sms. If you do try this, please let us know how it goes and if you hit any obstacles. We'd love to see this working. |
Summary
Adding phone number support for whatsapp and sms TOTP verification.
Notes
This is the first draft of the model changes for fast feedback.
References
#49