@mvx/identity
Version:
identity is oidc for mvc, type-mvc is base on koa. Decorator, Ioc, AOP mvc framework on server.
45 lines (43 loc) • 2.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IdentityStartupService = void 0;
var tslib_1 = require("tslib");
var ioc_1 = require("@tsdi/ioc");
var mvc_1 = require("@mvx/mvc");
var passports_1 = require("./passports");
var IdentityStartupService = /** @class */ (function (_super) {
tslib_1.__extends(IdentityStartupService, _super);
function IdentityStartupService() {
return _super !== null && _super.apply(this, arguments) || this;
}
IdentityStartupService.prototype.startup = function (ctx, middlewares) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var passport, services, cfs;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
passport = ctx.injector.get(passports_1.AuthenticatorToken);
services = ctx.injector.getServices(passports_1.PassportBuildService);
cfs = services.find(function (s) { return s instanceof passports_1.ConfigurePassportBuildService; });
if (cfs && services.indexOf(cfs) > 0) {
services.splice(services.indexOf(cfs), 1);
services.unshift(cfs);
}
return [4 /*yield*/, Promise.all(services.map(function (s) { return s.build(passport, ctx.getConfiguration()); }))];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
IdentityStartupService.ρAnn = function () {
return { "name": "IdentityStartupService", "params": { "startup": ["ctx", "middlewares"] } };
};
IdentityStartupService = tslib_1.__decorate([
ioc_1.Singleton
], IdentityStartupService);
return IdentityStartupService;
}(mvc_1.BeforeMidddlewareStartupService));
exports.IdentityStartupService = IdentityStartupService;
//# sourceMappingURL=sourcemaps/IdentityStartupService.js.map