Skip to content
Snippets Groups Projects
Commit 10aec5ab authored by James Calfee's avatar James Calfee Committed by Valentine Zavgorodnev
Browse files

498 phone number validation2 (#504)

* Update SMS country code drop down order.  Top 5 countries at the top.

* Remove zero prefix from country code.

* Remove Russia from top 5 in country code drop down.  They have their own blockchain.
parent f2f155ec
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,13 @@ import React from 'react' ...@@ -2,6 +2,13 @@ import React from 'react'
export default props => { export default props => {
return <select {...props}> return <select {...props}>
{/* Top countries (duplicated from below) */}
<option value="1">United States +(1)</option>
<option value="44">United Kingdom +(44)</option>
<option value="1">Canada +(1)</option>
<option value="34">Spain +(34)</option>
{/* TeleSign supported country codes */}
<option value=""></option> <option value=""></option>
<option value="93">Afghanistan +(93)</option> <option value="93">Afghanistan +(93)</option>
<option value="355">Albania +(355)</option> <option value="355">Albania +(355)</option>
......
...@@ -103,7 +103,7 @@ export default function useEnterAndConfirmMobilePages(app) { ...@@ -103,7 +103,7 @@ export default function useEnterAndConfirmMobilePages(app) {
const localPhone = this.request.body.phone; const localPhone = this.request.body.phone;
const enterMobileUrl = `/enter_mobile?phone=${localPhone}&country=${country}` const enterMobileUrl = `/enter_mobile?phone=${localPhone}&country=${country}`
if (!country && country === '') { if (!country || country === '') {
this.flash = {error: 'Please select a country code'}; this.flash = {error: 'Please select a country code'};
this.redirect(enterMobileUrl); this.redirect(enterMobileUrl);
return; return;
...@@ -115,7 +115,7 @@ export default function useEnterAndConfirmMobilePages(app) { ...@@ -115,7 +115,7 @@ export default function useEnterAndConfirmMobilePages(app) {
return; return;
} }
const phone = digits(country + localPhone) const phone = digits(parseInt(country) + localPhone)
const eid = yield models.Identity.findOne( const eid = yield models.Identity.findOne(
{attributes: ['id'], where: {user_id, provider: 'email', verified: true}, order: 'id DESC'} {attributes: ['id'], where: {user_id, provider: 'email', verified: true}, order: 'id DESC'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment