UNPKG

@dxdeveloperexperience/hygie

Version:

Hygie is an easy-to-use Open-Source REST API allowing you to interact with GIT events. This NestJS API expose a set of customizable rules to automate your project's life cycle.

22 lines (19 loc) 632 B
import { of, Observable } from 'rxjs'; import { ExecutionContext, CallHandler, NestInterceptor, HttpStatus, } from '@nestjs/common'; export class MockWhiteListInterceptorNext implements NestInterceptor { intercept(context: ExecutionContext, next: CallHandler): Observable<any> { return next.handle(); } } export class MockWhiteListInterceptorBlock implements NestInterceptor { intercept(context: ExecutionContext, next: CallHandler): Observable<any> { const response = context.switchToHttp().getResponse(); response.status(HttpStatus.UNAUTHORIZED).send('Beta access required.'); return of([]); } }