From e2c9f3c987a8cde4673cefee64627d5fc5c94c87 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 1 Dec 2015 09:58:39 +0100 Subject: [PATCH] fix checksley initialization in login --- app/coffee/modules/auth.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/coffee/modules/auth.coffee b/app/coffee/modules/auth.coffee index d2d3639c..bc2aaa03 100644 --- a/app/coffee/modules/auth.coffee +++ b/app/coffee/modules/auth.coffee @@ -221,6 +221,8 @@ module.directive("tgPublicRegisterMessage", ["$tgConfig", "$tgNavUrls", "$tgTemp LoginDirective = ($auth, $confirm, $location, $config, $routeParams, $navUrls, $events, $translate) -> link = ($scope, $el, $attrs) -> + form = new checksley.Form($el.find("form.login-form")) + onSuccess = (response) -> if $routeParams['next'] and $routeParams['next'] != $navUrls.resolve("login") nextUrl = decodeURIComponent($routeParams['next']) @@ -236,7 +238,6 @@ LoginDirective = ($auth, $confirm, $location, $config, $routeParams, $navUrls, $ submit = debounce 2000, (event) => event.preventDefault() - form = new checksley.Form($el.find("form.login-form")) if not form.validate() return