mirror of
https://github.com/bitwarden/desktop.git
synced 2024-10-04 04:58:05 +02:00
validate password upon registration
This commit is contained in:
parent
ddd76357cd
commit
edd1569eed
@ -21,6 +21,14 @@
|
|||||||
toastr.error('Master password is required.', 'Errors have occurred');
|
toastr.error('Master password is required.', 'Errors have occurred');
|
||||||
return;
|
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) {
|
if (model.masterPassword !== model.masterPasswordRetype) {
|
||||||
toastr.error('Master password confirmation does not match.', 'Errors have occurred');
|
toastr.error('Master password confirmation does not match.', 'Errors have occurred');
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user