Skip to content

Commit

Permalink
Merge pull request #2 from lots0logs/patch-1
Browse files Browse the repository at this point in the history
Properly handle the guard value being set in multiple contexts.
  • Loading branch information
timi137137 authored Oct 17, 2024
2 parents c9280d2 + 99b2ede commit 419a4c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ip-filter.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class IpFilterGuard implements CanActivate {
context: ExecutionContext,
): Promise<boolean> | Observable<boolean> | boolean {
// get guard
const guard = this.reflector.get<boolean>('ipFilter', context.getHandler());
const guard = this.reflector.getAllAndOverride<boolean>('ipFilter', [context.getHandler(), context.getClass()]);

// if not global and guard is not defined, then skip ip filter
if (!this.ipFilterService.isGlobal && guard === undefined) {
Expand Down

0 comments on commit 419a4c7

Please sign in to comment.