Shaulbm / moovNowMVP

0 stars 0 forks source link

Verify phone number in user profile #612

Closed Shaulbm closed 2 months ago

Shaulbm commented 5 months ago

When a user is adding a phone number he needs to verify it with a code - the verfication is in the BE to remove options for manipulation.

Don't allow the user to select pereferredChannel as WhatsAPP before he verify his phone number.

verify phone number: insert phone number once phone number is not empty / changed, ask to verify and don't let save before it is verified

have a button that says verify - and open a dialog with text that a message was sent to this number and please type back the code. IF not received verify it is with the international prefix and present an example. let the user cancel.

verified phone number BE: ask to verify phone number for user delete previous codes for this user create a code for user id and a number and save it in phoneNumberVerificationCollection { id: '', userId:'', phoneNumber: '', verificationNumber:'', state: verified / not verified timeStamp:'' }

send the user a whatsApp with the verification code. call verifyPhoneNumberResponse (code)- get the document and comapre, if good - return true and update to verified.

on update details - if phone number is not empty, compare to phone number in phoneNumberVerificationCollection and see it's verified, if not, remove the phone number.