Detecting short password errors and showing proper error

stable
Alejandro Alonso 2014-10-02 17:04:31 +02:00 committed by Jesús Espino
parent 61fb08de6c
commit 888c072f0b
2 changed files with 6 additions and 2 deletions

View File

@ -224,8 +224,11 @@ RegisterDirective = ($auth, $confirm, $location, $navUrls, $config) ->
$location.path($navUrls.resolve("home")) $location.path($navUrls.resolve("home"))
onErrorSubmit = (response) -> onErrorSubmit = (response) ->
if response.data._error_message?
$confirm.notify("light-error", "According to our Oompa Loompas there was an error. #{response.data._error_message}") #TODO: i18n $confirm.notify("light-error", "According to our Oompa Loompas there was an error. #{response.data._error_message}") #TODO: i18n
form.setErrors(response.data)
submit = -> submit = ->
if not form.validate() if not form.validate()
return return

View File

@ -16,7 +16,8 @@ div.register-form-container(tg-register)
placeholder="Your email") placeholder="Your email")
fieldset fieldset
input(type="password", name="password", ng-model="data.password", data-required="true", input(type="password", name="password", ng-model="data.password",
data-required="true", data-minlength="4",
placeholder="Set a password (case sensitive)") placeholder="Set a password (case sensitive)")
fieldset fieldset