Skip to content

Commit e7278a3

Browse files
authored
Merge pull request #101 from weex/master
Handle + in contact field, fix mnemonic bypass method
2 parents eaa3e71 + c9b5e55 commit e7278a3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

rein/html/js/setup.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ function renderConfirmationPage() {
5959
function confirmMnemonic() {
6060
// TODO - Add a retry counter
6161
mnemonic = sessionStorage.mnemonic.split(' ');
62-
wordsToCheck = sessionStorage.wordsToCheck;
62+
wordsToCheck = sessionStorage.wordsToCheck.split(',');
6363
conditions = [];
64-
for (var i = 0, len = wordsToCheck; i < len; i++) {
64+
for (var i = 0; i < wordsToCheck.length; i++) {
6565
wordNo = wordsToCheck[i];
6666
conditions[i] = document.getElementById('word' + wordNo).value == mnemonic[wordNo - 1];
6767
}
6868
for (var i = 0; i < conditions.length; i++) {
6969
if (conditions[i] == false) {
70-
errors = "Some of the words you entered are incorrect. Try again.\n";
70+
errors = "Some of the words you entered are incorrect. Please try again or restart the setup.";
7171
document.getElementById('errors').innerText = errors;
7272
return
7373
}
@@ -79,7 +79,7 @@ function submitData() {
7979
urlEncodedDataPairs = ['name=' + sessionStorage.name, 'contact=' + sessionStorage.contact,
8080
'mediate=' + sessionStorage.mediate, 'mediatorFee=' + sessionStorage.mediatorFee,
8181
'mnemonic=' + sessionStorage.mnemonic];
82-
urlEncodedData = urlEncodedDataPairs.join('&').replace(/%20/g, '+');
82+
urlEncodedData = urlEncodedDataPairs.join('&').replace(/\+/, '%2B');
8383
var xhttp = new XMLHttpRequest();
8484
xhttp.open('POST', '/register-user', true);
8585
xhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

rein/html/setup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h4 id="ajax-header">Sign Up</h4>
1515
</div>
1616
</div>
1717
<div class="row" style="color: red">
18-
<div class="col-sm-offset-1 col-sm-6" id="errors">
18+
<div class="col-sm-offset-1 col-sm-6" style="padding-bottom: 10px;" id="errors">
1919
</div>
2020
</div>
2121
<div id="ajax-elements">

0 commit comments

Comments
 (0)