UNPKG

@restmatic/jwt-session

Version:

Provides Authentication to the RestMatic platform.

35 lines 1.59 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); /** * @file AuthMiddleware * @author Jim Bulkowski <jim.b@paperelectron.com> * @project Authentication * @license MIT {@link http://opensource.org/licenses/MIT} */ const plugin_tools_1 = require("@pomegranate/plugin-tools"); exports.AuthMiddleware = plugin_tools_1.CreatePlugin('merge') .configuration({ name: 'AuthenticationMiddleware', injectableParam: 'Middleware', injectableScope: 'namespace', depends: ['@restmatic/Core'], provides: ['@restmatic/Middleware'] }) .hooks({ load: (Injector, PluginLogger, PluginVariables, PluginFiles, Authentication) => __awaiter(this, void 0, void 0, function* () { PluginLogger.log('Creating Authentication Middleware.', 1); return { authenticationInitialize: Authentication.initialize(), authenticationSession: Authentication.session() }; }) }); //# sourceMappingURL=AuthMiddleware.js.map