Skip to content

The open alternative to Salesforce, designed for AI.

Fix bug on sso providers (#12841)

Antoine Moreauxf5c179a8bf88
diff --git a/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts b/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
index 8dd7b7ce63d..681fce87f1f 100644
--- a/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
@@ -399,23 +399,24 @@ export class UserWorkspaceService extends TypeOrmQueryService<UserWorkspace> {
displayName: workspace.displayName,
workspaceUrls: this.domainManagerService.getWorkspaceUrls(workspace),
logo: workspace.logo,
- sso: workspace.workspaceSSOIdentityProviders.reduce(
- (acc, identityProvider) =>
- acc.concat(
- identityProvider.status === 'Inactive'
- ? []
- : [
- {
- id: identityProvider.id,
- name: identityProvider.name,
- issuer: identityProvider.issuer,
- type: identityProvider.type,
- status: identityProvider.status,
- },
- ],
- ),
- [] as AvailableWorkspace['sso'],
- ),
+ sso:
+ workspace.workspaceSSOIdentityProviders?.reduce(
+ (acc, identityProvider) =>
+ acc.concat(
+ identityProvider.status === 'Inactive'
+ ? []
+ : [
+ {
+ id: identityProvider.id,
+ name: identityProvider.name,
+ issuer: identityProvider.issuer,
+ type: identityProvider.type,
+ status: identityProvider.status,
+ },
+ ],
+ ),
+ [] as AvailableWorkspace['sso'],
+ ) ?? [],
};
}