UNPKG

feathers-authentication-management

Version:

Adds sign up verification, forgotten password reset, and other capabilities to local feathers-authentication

25 lines (24 loc) 1.16 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const debug_1 = __importDefault(require("debug")); const AuthenticationManagementService_1 = require("./services/AuthenticationManagementService"); const options_1 = require("./options"); const debug = (0, debug_1.default)('authLocalMgnt:service'); function authenticationLocalManagement(_options, docs) { debug('service being configured.'); return function (app) { const defaultOptions = (0, options_1.makeDefaultOptions)(); const options = Object.assign({}, defaultOptions, _options); const path = (_options === null || _options === void 0 ? void 0 : _options.path) || options_1.defaultPath; const service = new AuthenticationManagementService_1.AuthenticationManagementService(app, options); if (docs) { // @ts-expect-error service does not have docs service.docs = docs; } app.use(path, service); }; } exports.default = authenticationLocalManagement;