import { ExecutionContext , Injectable , CanActivate } from '@nestjs/common' ; @ Injectable ( ) export class AuthGuard implements CanActivate { public async canActivate ( context ) { const request = context . switchToHttp ( ) . getRequest ( ) ; const authHeader = request . get ( 'Authorization' ) ; if ( authHeader ) { return true ; } return false ; } }