diff --git a/packages/nocodb/src/controllers/auth/auth.controller.ts b/packages/nocodb/src/controllers/auth/auth.controller.ts index 3b5c7c1e01..bee594a67a 100644 --- a/packages/nocodb/src/controllers/auth/auth.controller.ts +++ b/packages/nocodb/src/controllers/auth/auth.controller.ts @@ -83,7 +83,7 @@ export class AuthController { NcError.forbidden('Email authentication is disabled'); } await this.setRefreshToken({ req, res }); - res.json(await this.usersService.login(req.user)); + res.json(await this.usersService.login(req.user, req)); } @UseGuards(GlobalGuard) @@ -106,7 +106,7 @@ export class AuthController { @UseGuards(PublicApiLimiterGuard, AuthGuard('google')) async googleSignin(@Request() req, @Response() res) { await this.setRefreshToken({ req, res }); - res.json(await this.usersService.login(req.user)); + res.json(await this.usersService.login(req.user, req)); } @Get('/auth/google') diff --git a/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts b/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts index 11e8e1a125..e4cf6944ef 100644 --- a/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts @@ -1527,8 +1527,8 @@ export class AtImportProcessor { url: attachment.url, size: attachment.size, mimetype: attachment.type, - req:{} - })), + })), req:{} + }); } catch (e) { console.log(e); diff --git a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts index 51da20e28a..a7882608c1 100644 --- a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts +++ b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts @@ -72,6 +72,7 @@ export class DuplicateController { ...(body.base || {}), }, user: { id: req.user.id }, + req }); const job = await this.jobsService.add(JobTypes.DuplicateBase, { @@ -141,6 +142,7 @@ export class DuplicateController { ...(body.base || {}), }, user: { id: req.user.id }, + req }); const job = await this.jobsService.add(JobTypes.DuplicateBase, { diff --git a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts index dc7898facd..e054b22a13 100644 --- a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts @@ -104,12 +104,14 @@ export class DuplicateProcessor { status: null, }, user: req.user, + req }); } catch (e) { if (dupProject?.id) { await this.projectsService.baseSoftDelete({ baseId: dupProject.id, user: req.user, + req }); } throw e; diff --git a/packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts b/packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts index cd3dc0145c..b294407716 100644 --- a/packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts @@ -21,11 +21,12 @@ export class MetaSyncProcessor { } = job.data; if (info.sourceId === 'all') { - await this.metaDiffsService.metaDiffSync({ baseId: info.baseId }); + await this.metaDiffsService.metaDiffSync({ baseId: info.baseId, req: {} }); } else { await this.metaDiffsService.baseMetaDiffSync({ baseId: info.baseId, sourceId: info.sourceId, + req: {} }); } diff --git a/packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts b/packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts index 03a481d85f..b0679bc6f9 100644 --- a/packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts @@ -18,6 +18,7 @@ export class SourceDeleteProcessor { await this.sourcesService.baseDelete({ sourceId, + req: {} }); this.debugLog(`job completed for ${job.id}`); diff --git a/packages/nocodb/src/services/sources.service.ts b/packages/nocodb/src/services/sources.service.ts index 4cc050510e..6355da5063 100644 --- a/packages/nocodb/src/services/sources.service.ts +++ b/packages/nocodb/src/services/sources.service.ts @@ -53,7 +53,7 @@ export class SourcesService { return sources; } - async baseDelete(param: { sourceId: string; req:any}) { + async baseDelete(param: { sourceId: string; req: any}) { try { const source = await Source.get(param.sourceId, true); await source.delete();