Skip to content

Commit

Permalink
fix: fixes bug where 'this' is undefined in 'getTracker','generateKey'
Browse files Browse the repository at this point in the history
  • Loading branch information
AljazOblonsek authored and jmcdo29 committed Dec 18, 2023
1 parent 66869d2 commit 8e0d707
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/throttler.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export class ThrottlerGuard implements CanActivate {
generateKey: this.options.generateKey,
};
}
this.commonOptions.getTracker ??= this.getTracker;
this.commonOptions.generateKey ??= this.generateKey;
this.commonOptions.getTracker ??= this.getTracker.bind(this);
this.commonOptions.generateKey ??= this.generateKey.bind(this);
}

/**
Expand Down

0 comments on commit 8e0d707

Please sign in to comment.