The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
refactor: scope ApplicationRegistrationService findOneById to tenant rows (#20408)
Félix Malfait23aa859502a8
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-registration/application-registration.service.ts b/packages/twenty-server/src/engine/core-modules/application/application-registration/application-registration.service.tsindex d4baeb818a8..7c92c806be1 100644--- a/packages/twenty-server/src/engine/core-modules/application/application-registration/application-registration.service.ts+++ b/packages/twenty-server/src/engine/core-modules/application/application-registration/application-registration.service.ts@@ -6,7 +6,7 @@ import crypto from 'crypto';import * as bcrypt from 'bcrypt';import { type Manifest } from 'twenty-shared/application';import { isDefined } from 'twenty-shared/utils';-import { IsNull, type Repository } from 'typeorm';+import { type Repository } from 'typeorm';import { v4 } from 'uuid';import { ALL_OAUTH_SCOPES } from 'src/engine/core-modules/application/application-oauth/constants/oauth-scopes';@@ -61,10 +61,7 @@ export class ApplicationRegistrationService {ownerWorkspaceId: string,): Promise<ApplicationRegistrationEntity> {const registration = await this.applicationRegistrationRepository.findOne({- where: [- { id, ownerWorkspaceId },- { id, ownerWorkspaceId: IsNull() },- ],+ where: { id, ownerWorkspaceId },});if (!registration) {