@vendure/core
Version:
A modern, headless ecommerce framework
30 lines (29 loc) • 1.42 kB
TypeScript
import { CanActivate, ExecutionContext } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import { ConfigService } from '../../config/config.service';
import { RequestContextService } from '../../service/helpers/request-context/request-context.service';
import { ChannelService } from '../../service/services/channel.service';
import { CustomerService } from '../../service/services/customer.service';
import { SessionService } from '../../service/services/session.service';
/**
* @description
* A guard which:
*
* 1. checks for the existence of a valid session token in the request and if found,
* attaches the current User entity to the request.
* 2. enforces any permissions required by the target handler (resolver, field resolver or route),
* and throws a ForbiddenError if those permissions are not present.
*/
export declare class AuthGuard implements CanActivate {
private reflector;
private configService;
private requestContextService;
private sessionService;
private customerService;
private channelService;
strategy: any;
constructor(reflector: Reflector, configService: ConfigService, requestContextService: RequestContextService, sessionService: SessionService, customerService: CustomerService, channelService: ChannelService);
canActivate(context: ExecutionContext): Promise<boolean>;
private setActiveChannel;
private getSession;
}