stable
David Barragán Merino 2014-08-25 12:51:34 +02:00
parent 79def2f779
commit a94ddf5fd2
1 changed files with 12 additions and 9 deletions

View File

@ -155,22 +155,25 @@ LoginDirective = ($auth, $confirm, $location, $config, $routeParams) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
$scope.pubblicRegisterEnabled = $config.get("pubblicRegisterEnabled") $scope.pubblicRegisterEnabled = $config.get("pubblicRegisterEnabled")
$scope.data = {} $scope.data = {}
form = $el.find("form").checksley()
onSuccessSubmit = (response) -> onSuccessSubmit = (response) ->
if $routeParams and $routeParams['next'] and $routeParams['next'] != '/login' # NOTE: Hack to remember the login form values
$el.find("form").attr('action', $routeParams['next']) form = $el.find("form")
else
$el.find("form").attr('action', "/")
$el.find("form") form.attr("method", "POST")
.submit() if $routeParams['next'] and $routeParams['next'] != '/login'
form.attr("action", $routeParams['next'])
else
form.attr("action", "/")
form.submit()
onErrorSubmit = (response) -> onErrorSubmit = (response) ->
$confirm.notify("light-error", "According to our Oompa Loompas, your username/email or password $confirm.notify("light-error", "According to our Oompa Loompas, your username/email
are incorrect.") #TODO: i18n or password are incorrect.") #TODO: i18n
submit = -> submit = ->
form = $el.find("form").checksley()
if not form.validate() if not form.validate()
return return