1 | "use strict";
|
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
4 | };
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 | const debug_1 = __importDefault(require("debug"));
|
7 | const AuthenticationManagementService_1 = require("./services/AuthenticationManagementService");
|
8 | const options_1 = require("./options");
|
9 | const debug = (0, debug_1.default)('authLocalMgnt:service');
|
10 | function authenticationLocalManagement(_options, docs) {
|
11 | debug('service being configured.');
|
12 | return function (app) {
|
13 | const defaultOptions = (0, options_1.makeDefaultOptions)();
|
14 | const options = Object.assign({}, defaultOptions, _options);
|
15 | const path = (_options === null || _options === void 0 ? void 0 : _options.path) || options_1.defaultPath;
|
16 | const service = new AuthenticationManagementService_1.AuthenticationManagementService(app, options);
|
17 | if (docs) {
|
18 |
|
19 | service.docs = docs;
|
20 | }
|
21 | app.use(path, service);
|
22 | };
|
23 | }
|
24 | exports.default = authenticationLocalManagement;
|