added comments

This commit is contained in:
Igor Hrenowitsch Propisnov 2024-05-04 23:30:59 +02:00
parent 250c48e8c6
commit 0d94527aec
1 changed files with 2 additions and 0 deletions

View File

@ -12,11 +12,13 @@ export class AccessTokenGuard extends AuthGuard('jwt-access-token') {
public canActivate(
context: ExecutionContext
): boolean | Promise<boolean> | Observable<boolean> {
// Check if the current route is marked as public
const isPublic = this.reflector.getAllAndOverride<boolean>('isPublic', [
context.getHandler(),
context.getClass(),
]);
// Allow access if the route is public, otherwise defer to the standard JWT authentication mechanism
if (isPublic) {
return true;
}