aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/keychains
diff options
context:
space:
mode:
authorcriw <criw@protonmail.com>2018-03-06 11:43:12 +0800
committercriw <criw@protonmail.com>2018-03-06 11:43:12 +0800
commitb393b54e35091efd3f49e9eccaf472c91f5bd0d1 (patch)
treea24c8026efd8a605df6983f57ad7c0f9fad31258 /ui/app/keychains
parent1bd18cebd7e08edbbcf35407b962e71dcd2c3399 (diff)
downloadtangerine-wallet-browser-b393b54e35091efd3f49e9eccaf472c91f5bd0d1.tar
tangerine-wallet-browser-b393b54e35091efd3f49e9eccaf472c91f5bd0d1.tar.gz
tangerine-wallet-browser-b393b54e35091efd3f49e9eccaf472c91f5bd0d1.tar.bz2
tangerine-wallet-browser-b393b54e35091efd3f49e9eccaf472c91f5bd0d1.tar.lz
tangerine-wallet-browser-b393b54e35091efd3f49e9eccaf472c91f5bd0d1.tar.xz
tangerine-wallet-browser-b393b54e35091efd3f49e9eccaf472c91f5bd0d1.tar.zst
tangerine-wallet-browser-b393b54e35091efd3f49e9eccaf472c91f5bd0d1.zip
FIX #3440 improved verification of restore from seed phrase
Diffstat (limited to 'ui/app/keychains')
-rw-r--r--ui/app/keychains/hd/restore-vault.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/app/keychains/hd/restore-vault.js b/ui/app/keychains/hd/restore-vault.js
index a4ed137f9..c4ba0d8fd 100644
--- a/ui/app/keychains/hd/restore-vault.js
+++ b/ui/app/keychains/hd/restore-vault.js
@@ -141,6 +141,19 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () {
// check seed
var seedBox = document.querySelector('textarea.twelve-word-phrase')
var seed = seedBox.value.trim()
+
+ // true if the string has more than a space between words.
+ if (seed.split(' ').length > 1) {
+ this.warning = 'there can only a space between words'
+ this.props.dispatch(actions.displayWarning(this.warning))
+ return
+ }
+ // true if seed contains a character that is not between a-z or a space
+ if(!seed.match(/^[a-z ]+$/)) {
+ this.warning = 'seed words only have lowercase characters'
+ this.props.dispatch(actions.displayWarning(this.warning))
+ return
+ }
if (seed.split(' ').length !== 12) {
this.warning = 'seed phrases are 12 words long'
this.props.dispatch(actions.displayWarning(this.warning))