mongodb-dynamic-api
Version:
Auto generated CRUD API for MongoDB using NestJS
23 lines • 888 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthDecoratorsBuilder = void 0;
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const decorators_1 = require("../../decorators");
const modules_1 = require("../../modules");
class AuthDecoratorsBuilder {
constructor(isProtected, AuthPoliciesGuard) {
this.isProtected = isProtected;
this.AuthPoliciesGuard = AuthPoliciesGuard;
}
build() {
return !this.isProtected
? [(0, decorators_1.Public)()]
: [
(0, swagger_1.ApiBearerAuth)(),
(0, common_1.UseGuards)(modules_1.JwtAuthGuard, ...(this.AuthPoliciesGuard ? [this.AuthPoliciesGuard] : [])),
];
}
}
exports.AuthDecoratorsBuilder = AuthDecoratorsBuilder;
//# sourceMappingURL=auth-decorators.builder.js.map