Skip to content

Commit

Permalink
fix(): fallback to empty options object if not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Feb 16, 2022
1 parent 954ed80 commit a9c9334
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ function createAuthGuard(type?: string | string[]): Type<CanActivate> {
class MixinAuthGuard<TUser = any> 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) {
Expand Down

0 comments on commit a9c9334

Please sign in to comment.