Created
September 29, 2020 13:42
-
-
Save talesmgodois/faade58a28f86cd12c5b5d4689585426 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common'; | |
import { Observable } from 'rxjs'; | |
@Injectable() | |
export class AuthGuard implements CanActivate { | |
canActivate( | |
context: ExecutionContext, | |
): boolean | Promise<boolean> | Observable<boolean> { | |
const request = context.switchToHttp().getRequest(); | |
return validateRequest(request); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment