LT-102: Send a email which includes password reset link if Forgot Password option is selected

- Add custom Reset Password template  and reset password
- Show the first error instead showing all errors of invalidated input values in Sign Up and changePassword templates
This commit is contained in:
Aysel Afsar committed 2016-03-16 10:28:07 -04:00
1 parent 28ba53b328
commit a5d4c6d0eb
8 files changed
+205 -26

No files matched your search

@@ -8,9 +8,9 @@
<div id="changePasswordPageMessage" class="subtitle-auth" style="{{getChangePasswordMessageColor}}">{{getChangePasswordMessage}}</div>
<form>
{{#if entryErrorMessages}}
{{#if changePasswordErrorMessages}}
<div id="errorMessages" class="list-errors">
{{#each entryErrorMessages}}
{{#each changePasswordErrorMessages}}
<div class="alert alert-danger list-item">{{this}}</div>
{{/each}}
</div>
@@ -46,14 +46,19 @@ Template.changePassword.helpers({
}
},
entryErrorMessages: function() {
var errorMessages = [];
Object.keys(ActiveEntry.errorMessages.all()).forEach(function(key) {
if ((key === "password" || key === "confirm") && ActiveEntry.errorMessages.get(key)) {
errorMessages.push(ActiveEntry.errorMessages.get(key));
}
changePasswordErrorMessages: function() {
var allErrorMessages = Object.keys(ActiveEntry.errorMessages.all()).filter(function(key) {
return (key === "password" || key === "confirm") && ActiveEntry.errorMessages.get(key);
});
return errorMessages;
if (allErrorMessages.length > 0) {
var errorMessage = ActiveEntry.errorMessages.get(allErrorMessages[0]);
if (errorMessage) {
return [errorMessage];
}
}
return;
}
});