mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 12:40:00 +00:00
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:
parent
56e2ec1bc4
commit
5e87b42af3
2 changed files with 13 additions and 9 deletions
|
|
@ -82,13 +82,17 @@ angular.module('authCtrl', [])
|
|||
};
|
||||
|
||||
$scope.passwordReset = function(email){
|
||||
$http.post(ApiUrlService.get() + '/api/v2/user/reset-password', {email:email})
|
||||
.success(function(){
|
||||
alert(window.env.t('newPassSent'));
|
||||
})
|
||||
.error(function(data){
|
||||
alert(data.err);
|
||||
});
|
||||
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'));
|
||||
})
|
||||
.error(function(data){
|
||||
alert(data.err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.expandMenu = function(menu) {
|
||||
|
|
|
|||
|
|
@ -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'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue