Detecting short password errors and showing proper error

stable
Alejandro Alonso 2014-10-02 17:04:31 +02:00
parent 2081194857
commit 33d723f4ec
2 changed files with 6 additions and 2 deletions

View File

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

View File

@ -16,7 +16,8 @@ div.register-form-container(tg-register)
placeholder="Your email")
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)")
fieldset