UNPKG

780 BJavaScriptView Raw
1/**
2 * joola.io
3 *
4 * Copyright Joola Smart Solutions, Ltd. <info@joo.la>
5 *
6 * Licensed under GNU General Public License 3.0 or later.
7 * Some rights reserved. See LICENSE, AUTHORS.
8 *
9 * @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
10 */
11
12var
13 joola = global.joola, //for jslint
14 ce = require('cloneextend'),
15 _datatables = require('../objects/datatables'),
16 connector = require('../connectors/connector');
17
18exports.login = function (username, password, next) {
19 var user = joola.config.auth.organizations[0].users[joola.config.auth.organizations[0].users.length - 1];
20 if (user) {
21 joola.logger.info('Joola authentication success [' + username + ']...');
22 return next(user);
23 }
24 else
25 throw new Error('No users found.');
26};
\No newline at end of file