change password validation

stable
Juanfran 2016-02-03 08:58:31 +01:00
parent 8790040190
commit 78ebcdfbb5
2 changed files with 8 additions and 0 deletions

View File

@ -63,9 +63,14 @@ module.controller("UserChangePasswordController", UserChangePasswordController)
UserChangePasswordDirective = ($rs, $confirm, $loading, $translate) ->
link = ($scope, $el, $attrs, ctrl) ->
form = new checksley.Form($el.find("form"))
submit = debounce 2000, (event) =>
event.preventDefault()
if not form.validate()
return
if $scope.newPassword1 != $scope.newPassword2
$confirm.notify('error', $translate.instant("CHANGE_PASSWORD.ERROR_PASSWORD_MATCH"))
return

View File

@ -17,6 +17,7 @@ div.wrapper(
fieldset
label(for="current-password", translate="CHANGE_PASSWORD.FIELD_CURRENT_PASSWORD")
input(
data-required="true"
type="password"
name="password"
id="current-password"
@ -28,6 +29,7 @@ div.wrapper(
fieldset
label(for="new-password", translate="CHANGE_PASSWORD.FIELD_NEW_PASSWORD")
input(
data-required="true"
type="password"
name="new-password"
id="new-password"
@ -39,6 +41,7 @@ div.wrapper(
fieldset
label(for="retype-password", translate="CHANGE_PASSWORD.FIELD_RETYPE_PASSWORD")
input(
data-required="true"
type="password"
name="retype-password"
id="retype-password"