Front page's Forgot Password will report an invalid email address instead of simply errorring. Does NOT include updated locals/en/front.json

This commit is contained in:
gjoyner 2014-10-13 23:47:34 -07:00
parent 56e2ec1bc4
commit 5e87b42af3
2 changed files with 13 additions and 9 deletions

View file

@ -82,6 +82,9 @@ angular.module('authCtrl', [])
};
$scope.passwordReset = function(email){
if(email == null || email.length == 0) {
alert(window.env.t('invalidEmail'));
} else {
$http.post(ApiUrlService.get() + '/api/v2/user/reset-password', {email:email})
.success(function(){
alert(window.env.t('newPassSent'));
@ -89,6 +92,7 @@ angular.module('authCtrl', [])
.error(function(data){
alert(data.err);
});
}
};
$scope.expandMenu = function(menu) {

View file

@ -39,12 +39,12 @@ script(id='modals/login.html', type='text/ng-template')
a(data-toggle="collapse" data-parent="#forgot-password" href="#forgot-password-panel")=env.t('forgotPass')
.panel-body.collapse#forgot-password-panel
form(ng-submit='passwordReset(passwordResetEmail)')
form(name='passwordResetForm', ng-submit='passwordReset(passwordResetEmail)', novalidate)
//.alert.alert-success {.success.passwordReset}
//.control-group.{#if..errors.passwordReset}error{/}
h3=env.t('emailNewPass')
.form-group
input.form-control(type='text', name='email', placeholder=env.t('email') , ng-model='passwordResetEmail')
input.form-control(type='email', name='email', placeholder=env.t('email') , ng-model='passwordResetEmail')
//span.help-inline {.errors.passwordReset}
.form-group
input.btn.btn-default(type='submit', value=env.t('submit'))