diff --git a/lib/auth.guard.ts b/lib/auth.guard.ts index d6547798..b96ee483 100644 --- a/lib/auth.guard.ts +++ b/lib/auth.guard.ts @@ -22,6 +22,7 @@ export type IAuthGuard = CanActivate & { ): Promise; handleRequest(err, user, info, context, status?): TUser; getAuthenticateOptions(context): IAuthModuleOptions | undefined; + getRequest(context: ExecutionContext): T; }; export const AuthGuard: ( type?: string | string[] @@ -29,8 +30,8 @@ export const AuthGuard: ( const NO_STRATEGY_ERROR = `In order to use "defaultStrategy", please, ensure to import PassportModule in each place where AuthGuard() is being used. Otherwise, passport won't work correctly.`; -function createAuthGuard(type?: string | string[]): Type { - class MixinAuthGuard implements CanActivate { +function createAuthGuard(type?: string | string[]): Type { + class MixinAuthGuard implements IAuthGuard { constructor(@Optional() protected readonly options?: AuthModuleOptions) { this.options = this.options || {}; if (!type && !this.options.defaultStrategy) {