UNPKG

@nestjs-mod/sso

Version:

NestJS SDK for Single Sign-On on NestJS and Angular with webhooks and social authorization (Wrapper for https://www.npmjs.com/package/@nestjs-mod/sso-rest-sdk)

25 lines 1.39 kB
"use strict"; var _a; Object.defineProperty(exports, "__esModule", { value: true }); exports.CurrentSsoUserToken = exports.CurrentSsoUser = exports.CheckSsoAccess = exports.AllowEmptySsoUser = exports.getSsoEnvironmentsLoaderToken = exports.getSsoServiceToken = exports.InjectSsoService = void 0; const common_1 = require("@nestjs-mod/common"); const core_1 = require("@nestjs/core"); const common_2 = require("@nestjs/common"); const sso_constants_1 = require("./sso.constants"); exports.InjectSsoService = (0, common_1.getNestModuleDecorators)({ moduleName: sso_constants_1.SSO_MODULE, }).InjectService; _a = (0, common_1.getNestModuleInternalUtils)({ moduleName: sso_constants_1.SSO_MODULE, }), exports.getSsoServiceToken = _a.getServiceToken, exports.getSsoEnvironmentsLoaderToken = _a.getEnvironmentsLoaderToken; exports.AllowEmptySsoUser = core_1.Reflector.createDecorator(); exports.CheckSsoAccess = core_1.Reflector.createDecorator(); exports.CurrentSsoUser = (0, common_2.createParamDecorator)((data, ctx) => { const request = (0, common_1.getRequestFromExecutionContext)(ctx); return request.ssoUser; }); exports.CurrentSsoUserToken = (0, common_2.createParamDecorator)((data, ctx) => { const request = (0, common_1.getRequestFromExecutionContext)(ctx); return request?.headers?.authorization?.split(' ')[1]; }); //# sourceMappingURL=sso.decorators.js.map