2017-06-10 22:50:48 +02:00
|
|
|
// vim: set tw=80 ts=4 sw=4 sts=4:
|
|
|
|
/*
|
|
|
|
This file is part of Accountant.
|
|
|
|
|
|
|
|
Accountant is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Accountant is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
/* jshint node: true */
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var angular = require('angular');
|
|
|
|
|
2017-06-11 00:48:03 +02:00
|
|
|
var ngStorage = require('meanie-angular-storage'),
|
2017-07-08 12:12:20 +02:00
|
|
|
ngHttpAuth = require('angular-http-auth'),
|
|
|
|
ngStrap = require('angular-strap');
|
2017-06-10 22:50:48 +02:00
|
|
|
|
|
|
|
// Note: ngHttpAuth seems to have no module.exports.
|
|
|
|
ngHttpAuth = 'http-auth-interceptor';
|
|
|
|
|
2017-07-08 00:51:59 +02:00
|
|
|
var LoginService = require('./login.service');
|
|
|
|
var LoginConfig = require('./login.config');
|
|
|
|
|
2017-07-06 10:35:15 +02:00
|
|
|
module.exports = angular.module('accountant.login', [
|
2017-06-10 22:50:48 +02:00
|
|
|
ngHttpAuth,
|
2017-07-08 09:39:18 +02:00
|
|
|
ngStorage
|
2017-06-10 22:50:48 +02:00
|
|
|
])
|
|
|
|
|
2017-07-08 00:51:59 +02:00
|
|
|
.service('LoginService', LoginService)
|
2017-07-05 21:48:20 +02:00
|
|
|
|
2017-07-08 00:51:59 +02:00
|
|
|
.config(LoginConfig)
|
2017-07-05 21:48:20 +02:00
|
|
|
|
|
|
|
.run(function($rootScope, LoginService) {
|
2017-07-08 12:12:20 +02:00
|
|
|
var onAuthLoginRequired = $rootScope.$on('event:auth-loginRequired', LoginService.loginModal);
|
2017-07-05 21:48:20 +02:00
|
|
|
|
|
|
|
$rootScope.$on('$destroy', function() {
|
|
|
|
onAuthLoginRequired = angular.noop();
|
2017-06-10 22:50:48 +02:00
|
|
|
});
|
2017-07-06 10:35:15 +02:00
|
|
|
})
|
2017-06-10 22:50:48 +02:00
|
|
|
|
2017-07-06 10:35:15 +02:00
|
|
|
.name;
|