UNPKG

1.16 kBJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const debug_1 = __importDefault(require("debug"));
7const AuthenticationManagementService_1 = require("./services/AuthenticationManagementService");
8const options_1 = require("./options");
9const debug = (0, debug_1.default)('authLocalMgnt:service');
10function 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 // @ts-expect-error service does not have docs
19 service.docs = docs;
20 }
21 app.use(path, service);
22 };
23}
24exports.default = authenticationLocalManagement;