From a94ddf5fd2df3ce22e7e70f8136211a9d0195193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Mon, 25 Aug 2014 12:51:34 +0200 Subject: [PATCH] Fix bug #750 --- app/coffee/modules/auth.coffee | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/coffee/modules/auth.coffee b/app/coffee/modules/auth.coffee index 2f7d1ae9..f3b47768 100644 --- a/app/coffee/modules/auth.coffee +++ b/app/coffee/modules/auth.coffee @@ -155,22 +155,25 @@ LoginDirective = ($auth, $confirm, $location, $config, $routeParams) -> link = ($scope, $el, $attrs) -> $scope.pubblicRegisterEnabled = $config.get("pubblicRegisterEnabled") $scope.data = {} - form = $el.find("form").checksley() onSuccessSubmit = (response) -> - if $routeParams and $routeParams['next'] and $routeParams['next'] != '/login' - $el.find("form").attr('action', $routeParams['next']) - else - $el.find("form").attr('action', "/") + # NOTE: Hack to remember the login form values + form = $el.find("form") - $el.find("form") - .submit() + form.attr("method", "POST") + if $routeParams['next'] and $routeParams['next'] != '/login' + form.attr("action", $routeParams['next']) + else + form.attr("action", "/") + + form.submit() onErrorSubmit = (response) -> - $confirm.notify("light-error", "According to our Oompa Loompas, your username/email or password - are incorrect.") #TODO: i18n + $confirm.notify("light-error", "According to our Oompa Loompas, your username/email + or password are incorrect.") #TODO: i18n submit = -> + form = $el.find("form").checksley() if not form.validate() return