aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-03-14 05:39:59 +0800
committerGitHub <noreply@github.com>2018-03-14 05:39:59 +0800
commit34fe88af8f5f65e45809759c0753910ca3c00be8 (patch)
tree2cec237298912b9e27c9fe52b70442d41c3f4cab /old-ui
parent239d7106abe39b3a16871442b30edeac54b1bef4 (diff)
parentb393b54e35091efd3f49e9eccaf472c91f5bd0d1 (diff)
downloadtangerine-wallet-browser-34fe88af8f5f65e45809759c0753910ca3c00be8.tar
tangerine-wallet-browser-34fe88af8f5f65e45809759c0753910ca3c00be8.tar.gz
tangerine-wallet-browser-34fe88af8f5f65e45809759c0753910ca3c00be8.tar.bz2
tangerine-wallet-browser-34fe88af8f5f65e45809759c0753910ca3c00be8.tar.lz
tangerine-wallet-browser-34fe88af8f5f65e45809759c0753910ca3c00be8.tar.xz
tangerine-wallet-browser-34fe88af8f5f65e45809759c0753910ca3c00be8.tar.zst
tangerine-wallet-browser-34fe88af8f5f65e45809759c0753910ca3c00be8.zip
Merge pull request #3445 from TheCriw/i3440-seed-restore-trim-invalid-characters
improved verification of restore from seed phrase
Diffstat (limited to 'old-ui')
-rw-r--r--old-ui/app/keychains/hd/restore-vault.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/old-ui/app/keychains/hd/restore-vault.js b/old-ui/app/keychains/hd/restore-vault.js
index 222172dfd..dcadcccad 100644
--- a/old-ui/app/keychains/hd/restore-vault.js
+++ b/old-ui/app/keychains/hd/restore-vault.js
@@ -140,6 +140,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))