The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix(auth): handle missing workspaceId in auth service (#11173)
Antoine Moreaux20f2a251b61e
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.tsindex af12da975c0..db03c32b157 100644--- a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts@@ -562,12 +562,14 @@ export class AuthService {);}- return await this.workspaceRepository.findOne({- where: {- id: params.workspaceId,- },- relations: ['approvedAccessDomains'],- });+ return params.workspaceId+ ? await this.workspaceRepository.findOne({+ where: {+ id: params.workspaceId,+ },+ relations: ['approvedAccessDomains'],+ })+ : undefined;}formatUserDataPayload(