Detecting short password errors and showing proper error
parent
61fb08de6c
commit
888c072f0b
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue