From eba176c000da0eaff9102c86ba1983136df99bff Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 11 Jun 2017 09:17:42 +0200 Subject: [PATCH] Add cancelLogin method on LoginService. --- src/login/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/login/index.js b/src/login/index.js index 99a7dc1..913d642 100644 --- a/src/login/index.js +++ b/src/login/index.js @@ -64,8 +64,13 @@ var loginModule = angular.module('accountant.login', [ }); }; + var cancelLogin = function () { + // FIXME Alexis Lahouze 2017-06-11 Redirect to error page. + }; + return { - 'login': login + 'login': login, + 'cancelLogin': cancelLogin }; }) @@ -142,6 +147,8 @@ var loginModule = angular.module('accountant.login', [ .run(function($rootScope, LoginService) { var onAuthLoginRequired = $rootScope.$on('event:auth-loginRequired', LoginService.login); + var onAuthLoginCancelled = $rootScope.$on('event:auth-loginCancelled', LoginService.cancelLogin); + $rootScope.$on('$destroy', function() { onAuthLoginRequired = angular.noop(); });