1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

Validation adjustments.

This commit is contained in:
Kyle Spearrin
2016-09-22 13:03:28 -04:00
parent 3d7b32f359
commit eef4d6f48e
11 changed files with 30 additions and 18 deletions

View File

@@ -8,15 +8,19 @@
$scope.submitPromise = null;
$scope.submit = function (model) {
if (!model.email) {
toastr.error('Email is required.');
toastr.error('Email address is required.', 'Errors have occurred');
return;
}
if (model.email.indexOf('@') === -1) {
toastr.error('Invalid email address.', 'Errors have occurred');
return;
}
if (!model.masterPassword) {
toastr.error('Master password is required.');
toastr.error('Master password is required.', 'Errors have occurred');
return;
}
if (model.masterPassword !== model.masterPasswordRetype) {
toastr.error('Master password confirmation does not match.');
toastr.error('Master password confirmation does not match.', 'Errors have occurred');
return;
}