From a9c93348c503ae03e7bb0ad1fc72813245353c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20My=C5=9Bliwiec?= Date: Wed, 16 Feb 2022 10:24:28 +0100 Subject: [PATCH] fix(): fallback to empty options object if not provided --- 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 b6165df9..233b66db 100644 --- a/lib/auth.guard.ts +++ b/lib/auth.guard.ts @@ -33,7 +33,8 @@ function createAuthGuard(type?: string | string[]): Type { class MixinAuthGuard implements CanActivate { @Optional() @Inject(AuthModuleOptions) - protected options: AuthModuleOptions; + protected options: AuthModuleOptions = {}; + constructor(@Optional() options?: AuthModuleOptions) { this.options = options ?? this.options; if (!type && !this.options.defaultStrategy) {