X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sdnr%2Fwireless-transport%2Fcode-Carbon-SR1%2Fapps%2Fdlux%2Fdlux-web%2Fsrc%2Fcommon%2Flogin%2Flogin.module.js;fp=sdnr%2Fwireless-transport%2Fcode-Carbon-SR1%2Fapps%2Fdlux%2Fdlux-web%2Fsrc%2Fcommon%2Flogin%2Flogin.module.js;h=0000000000000000000000000000000000000000;hb=1c1e7f98416875f3ee78af9103865c32f95a82a0;hp=72702c656787e05bdbdb10ff92d5068afa5484cb;hpb=6a893bb0ae984d15076394d9225d4873ad953791;p=ccsdk%2Fapps.git diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.module.js deleted file mode 100644 index 72702c65..00000000 --- a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/src/common/login/login.module.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2014 Inocybe Technologies, and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -define(['angularAMD', 'jquery', 'common/authentification/auth.module', 'ocLazyLoad'], function (ng, $) { - var login = angular.module('app.common.login', ['app.common.auth', 'ui.router.state']); - - login.config(function ($stateProvider, $httpProvider) { - $stateProvider - .state('login', { - url: '/login', - views: { - 'mainContent@': { - templateUrl: 'src/common/login/login.tpl.html', - controller: 'LoginCtrl' - } - }, - resolve: { - loadController: ['$ocLazyLoad', function ($ocLazyLoad) { - return $ocLazyLoad.load({ - files: ['src/common/login/login.controller.js'] - }); - }] - } - }); - - $httpProvider.interceptors.push('NbInterceptor'); - }); - - login.run(function ($rootScope, $location, Auth) { - - // to avoid recursive loop - var publicPath = ['/login']; - - var isPublicPath = function (route) { - var found = false; - $.each(publicPath, function (key, value) { - found = found || route.match('^' + value); - }); - return found; - }; - - $rootScope.$on('$stateChangeStart', function () { - if (!isPublicPath($location.url()) && !Auth.isAuthed()) { - $location.path('/login'); - } - }); - - }); - - return login; -});