From 0d94527aec91c5c2eebb5343160e61956142979f Mon Sep 17 00:00:00 2001 From: Igor Propisnov Date: Sat, 4 May 2024 23:30:59 +0200 Subject: [PATCH] added comments --- .../src/modules/auth-module/common/guards/access-token.guard.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/modules/auth-module/common/guards/access-token.guard.ts b/backend/src/modules/auth-module/common/guards/access-token.guard.ts index d4e38d9..3ca8986 100644 --- a/backend/src/modules/auth-module/common/guards/access-token.guard.ts +++ b/backend/src/modules/auth-module/common/guards/access-token.guard.ts @@ -12,11 +12,13 @@ export class AccessTokenGuard extends AuthGuard('jwt-access-token') { public canActivate( context: ExecutionContext ): boolean | Promise | Observable { + // Check if the current route is marked as public const isPublic = this.reflector.getAllAndOverride('isPublic', [ context.getHandler(), context.getClass(), ]); + // Allow access if the route is public, otherwise defer to the standard JWT authentication mechanism if (isPublic) { return true; }