From 041023aa2b5246bef41d7f55da2c2ed5cdd9edc4 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 13 Apr 2023 11:12:13 +0530 Subject: [PATCH] fix: correction in global auth guard Signed-off-by: Pranav C --- packages/nocodb-nest/src/guards/global/global.guard.ts | 3 +++ packages/nocodb-nest/src/modules/users/users.controller.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/nocodb-nest/src/guards/global/global.guard.ts b/packages/nocodb-nest/src/guards/global/global.guard.ts index ed668b8957..4b0700468f 100644 --- a/packages/nocodb-nest/src/guards/global/global.guard.ts +++ b/packages/nocodb-nest/src/guards/global/global.guard.ts @@ -35,6 +35,9 @@ export class GlobalGuard extends AuthGuard(['jwt']) { }); } } + + if(result) return true; + if (req.headers['xc-token']) { let canActivate = false; try { diff --git a/packages/nocodb-nest/src/modules/users/users.controller.ts b/packages/nocodb-nest/src/modules/users/users.controller.ts index 00daa44f41..db36ba465a 100644 --- a/packages/nocodb-nest/src/modules/users/users.controller.ts +++ b/packages/nocodb-nest/src/modules/users/users.controller.ts @@ -9,10 +9,10 @@ import { Request, Response, UseGuards, -} from '@nestjs/common' +} from '@nestjs/common'; import * as ejs from 'ejs'; import { AuthGuard } from '@nestjs/passport'; -import { GlobalGuard } from '../../guards/global/global.guard' +import { GlobalGuard } from '../../guards/global/global.guard'; import { NcError } from '../../helpers/catchError'; import { Acl,