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)

27 lines 972 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SsoGuard = void 0; const tslib_1 = require("tslib"); const common_1 = require("@nestjs/common"); const sso_environments_1 = require("./sso.environments"); const sso_service_1 = require("./sso.service"); let SsoGuard = class SsoGuard { constructor(ssoService, ssoStaticEnvironments) { this.ssoService = ssoService; this.ssoStaticEnvironments = ssoStaticEnvironments; } async canActivate(context) { if (!this.ssoStaticEnvironments.useGuards) { return true; } await this.ssoService.getUserFromRequest(context); return true; } }; exports.SsoGuard = SsoGuard; exports.SsoGuard = SsoGuard = tslib_1.__decorate([ (0, common_1.Injectable)(), tslib_1.__metadata("design:paramtypes", [sso_service_1.SsoService, sso_environments_1.SsoStaticEnvironments]) ], SsoGuard); //# sourceMappingURL=sso.guard.js.map