hunk.code_window: import { EnvironmentWithSubscriber } from '../../../shared/commands/project.command';
   import { JobEntity } from '@novu/dal';
   export enum DetailEnum {
     STEP_CREATED = 'Step is created for execution',
     STEP_QUEUED = 'Step is queued for execution',
     MESSAGE_CONTENT_NOT_GENERATED = 'Message content could not be generated',
     MESSAGE_CREATED = 'Message created',
     SUBSCRIBER_NO_ACTIVE_INTEGRATION = 'Subscriber does not have an active integration',
  
hunk.labels: keep keep keep keep replace replace keep keep keep
hunk.after_edit:   STEP_CREATED = 'Step created',
     STEP_QUEUED = 'Step queued',
     STEP_DELAYED = 'Step delayed',
  
hunk.file_path: apps/api/src/app/execution-details/usecases/create-execution-details/create-execution-details.command.ts
hunk.type: replace
file: import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common';
  import { Reflector } from '@nestjs/core';
  import { ISubscriberJwt } from '@novu/shared';
  import * as jwt from 'jsonwebtoken';
  
  @Injectable()
  export class SubscriberRouteGuard implements CanActivate {
    constructor(private readonly reflector: Reflector) {}
  
    canActivate(context: ExecutionContext): boolean {
      const subscriberRouteGuard = this.reflector.get<string[]>('subscriberRouteGuard', context.getHandler());
      if (!subscriberRouteGuard) {
        return true;
      }
  
      const request = context.switchToHttp().getRequest();
      if (!request.headers.authorization) return false;
  
      const token = request.headers.authorization.split(' ')[1];
      if (!token) return false;
  
      const tokenContent = jwt.decode(token) as ISubscriberJwt;
      if (!tokenContent) return false;
      if (tokenContent.aud !== 'widget_user') return false;
      if (!tokenContent.environmentId) return false;
  
      return true;
    }
  }
  