From edd1569eed32a63faeb84ee9d3b461504121011a Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 3 Oct 2016 21:55:59 -0400 Subject: [PATCH] validate password upon registration --- src/popup/app/accounts/accountsRegisterController.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/popup/app/accounts/accountsRegisterController.js b/src/popup/app/accounts/accountsRegisterController.js index 522fe265..4bdcd09e 100644 --- a/src/popup/app/accounts/accountsRegisterController.js +++ b/src/popup/app/accounts/accountsRegisterController.js @@ -21,6 +21,14 @@ toastr.error('Master password is required.', 'Errors have occurred'); return; } + if (model.masterPassword.length < 8) { + toastr.error('Master password must be at least 8 characters long.', 'Errors have occurred'); + return; + } + if (!/[a-z]/i.test(model.masterPassword) || !/\d/.test(model.masterPassword)) { + toastr.error('Master password requires at least 1 letter and 1 number.', 'Errors have occurred'); + return; + } if (model.masterPassword !== model.masterPasswordRetype) { toastr.error('Master password confirmation does not match.', 'Errors have occurred'); return;