Permalink
Browse files

feat(login): new wallet name must be no longer than 16 chars

  • Loading branch information...
1 parent 6e69889 commit 6bb34c044640a554a87dec2bf56e6815048dc1f0 @beregovoy68 beregovoy68 committed Nov 21, 2016
Showing with 11 additions and 2 deletions.
  1. +2 −2 src/index.html
  2. +9 −0 src/js/login/account.register.controller.js
View
@@ -94,7 +94,7 @@ <h2 class="sectionHeader">REMOVE ACCOUNT <span id="removeAccountSpan"></span> -
<!-- Seed input -->
<div id="create-seed" ng-controller="accountSeedController as vm" ng-show="accounts.mode === 'create-seed'">
<form id="account-seed-form" name="accountSeedForm" ng-submit="vm.checkSeedAndRegister(accountSeedForm)" novalidate ng-validate="vm.validationOptions">
-
+
<button id="generateRandomSeed" class="wButton fade" ng-click="vm.generateSeed()" type="button">GENERATE NEW SEED</button>
<br/><br/>
<div class="form-field">
@@ -171,7 +171,7 @@ <h2 class="sectionHeader">NEW ACCOUNT - NOTICE</h2>
need to have assigned a name.</i>"></span>
<br/>
</label>
- <input type="text" id="walletName" class="wInput" ng-model="vm.name" focus-me="accounts.mode === 'register'"/>
+ <input type="text" id="walletName" name="walletName" class="wInput" ng-model="vm.name" focus-me="accounts.mode === 'register'"/>
</div>
<br/>
<div class="form-field">
@@ -1,12 +1,17 @@
(function () {
'use strict';
+ var WALLET_NAME_MAXLENGTH = 16;
+
function AccountRegisterController($scope, accountService, cryptoService, loginContext) {
var vm = this;
vm.validationOptions = {
onfocusout: false,
rules: {
+ walletName: {
+ maxlength: WALLET_NAME_MAXLENGTH
+ },
walletPassword: {
required: true,
minlength: 8,
@@ -17,6 +22,10 @@
}
},
messages: {
+ walletName: {
+ maxlength: 'A wallet name is too long. Maximum name length is ' +
+ WALLET_NAME_MAXLENGTH + ' characters'
+ },
walletPassword: {
required: 'A password is required to store your seed safely',
minlength: 'Password must be 8 characters or longer'

0 comments on commit 6bb34c0

Please sign in to comment.