ntls-io / nautilus-wallet

Nautilus Wallet
GNU Affero General Public License v3.0
8 stars 4 forks source link

No Validation on Mobile number of sign up #215

Open Claire-Bear opened 2 years ago

Claire-Bear commented 2 years ago
Claire-Bear commented 2 years ago

Validation should be shown to the user on invalid number formats

PiDelport commented 2 years ago

Relevant code:

https://github.com/ntls-io/nautilus-wallet/blob/1772a8bc65dc439b6ed131a5207be390f2f0e601/web-client/src/app/views/register/register.page.ts#L25-L30

https://github.com/ntls-io/nautilus-wallet/blob/1772a8bc65dc439b6ed131a5207be390f2f0e601/web-client/src/app/state/session.service.ts#L165-L167

PiDelport commented 2 years ago

As per the comments, we almost certainly want to replace this with something libphonenumber based that parses and validates the number to E.164 at entry time.

I didn't find a purpose-made Angular widget with a cursory search, so we may just want to pull in libphonenumber-js and hook that into the existing Angular form validation.

IscoRuta98 commented 2 years ago

@PiDelport, would somehting like this: How to add Angular phone number format, work?

PiDelport commented 2 years ago

Maybe, though that seems to use the heavier-weight google-libphonenumber port, rather than libphonenumber-js. I'm also wary of that widget's UI styling not necessarily working with our app; particularly, the fact that it seems to be based on ngx-bootstrap.

Googling a bit more, maybe this is worth a try? https://github.com/azzamasghar1/ion-intl-tel-input

IscoRuta98 commented 2 years ago

Thanks Pi! Checking it now. Quick question: are the forms we use template-driven or reactive?

PiDelport commented 2 years ago

Reactive.