NestJS - Guards
Given the following NestJS JWT guard code snippet, what will happen if the request has no Authorization header?
canActivate(context: ExecutionContext) {
const request = context.switchToHttp().getRequest();
const authHeader = request.headers['authorization'];
if (!authHeader) {
throw new UnauthorizedException('No token provided');
}
// further token validation...
return true;
}