import { CanActivate , ExecutionContext , Injectable } from '@nestjs/common' ; import { Observable } from 'rxjs' ; @ Injectable ( ) export class UserGuard implements CanActivate { canActivate ( context ) { const req = context . switchToHttp ( ) . getRequest ( ) ; return ! ! req . headers . auth ; } }