From 871bf00764bcc30b69de4fd860d6f2b43174af89 Mon Sep 17 00:00:00 2001 From: Julien Ferrier Date: Wed, 10 Feb 2021 15:47:31 +0100 Subject: [PATCH] feat: add getRequest method int IAuthGuard interface --- lib/auth.guard.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/auth.guard.ts b/lib/auth.guard.ts index d6547798..fbf44b5a 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,7 +30,7 @@ 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 { +function createAuthGuard(type?: string | string[]): Type { class MixinAuthGuard implements CanActivate { constructor(@Optional() protected readonly options?: AuthModuleOptions) { this.options = this.options || {};