The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix(auth): trust the identity provider's email for SSO sign-ups and show the real SAML/OIDC URLs (#27486)
Marie6fbaaa8ca179
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphqlindex 8d439652cd6..ee885fe8635 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql@@ -1139,6 +1139,7 @@ type ClientConfig {publicFeatureFlags: [PublicFeatureFlag!]!publicFunctionDomain: Stringsentry: Sentry!+ serverUrl: String!signInPrefilled: Boolean!support: Support!}diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.tsindex ef8001ca77a..8f1e0fee8a7 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts@@ -1027,6 +1027,7 @@ export interface ClientConfig {publicFeatureFlags: PublicFeatureFlag[]publicFunctionDomain?: Scalars['String']sentry: Sentry+ serverUrl: Scalars['String']signInPrefilled: Scalars['Boolean']support: Support__typename: 'ClientConfig'@@ -4975,6 +4976,7 @@ export interface ClientConfigGenqlSelection{publicFeatureFlags?: PublicFeatureFlagGenqlSelectionpublicFunctionDomain?: boolean | numbersentry?: SentryGenqlSelection+ serverUrl?: boolean | numbersignInPrefilled?: boolean | numbersupport?: SupportGenqlSelection__typename?: boolean | numberdiff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.tsindex b4ac241928f..abc5a38e3b7 100644--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts@@ -2462,6 +2462,9 @@ export default {"sentry": [448],+ "serverUrl": [+ 1+ ],"signInPrefilled": [4],diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.tsindex f2b0f413032..e17d2f020e6 100644--- a/packages/twenty-front/src/generated-metadata/graphql.ts+++ b/packages/twenty-front/src/generated-metadata/graphql.ts@@ -1241,6 +1241,7 @@ export type ClientConfig = {publicFeatureFlags: Array<PublicFeatureFlag>;publicFunctionDomain?: Maybe<Scalars['String']['output']>;sentry: Sentry;+ serverUrl: Scalars['String']['output'];signInPrefilled: Scalars['Boolean']['output'];support: Support;};diff --git a/packages/twenty-front/src/modules/client-config/hooks/useClientConfig.ts b/packages/twenty-front/src/modules/client-config/hooks/useClientConfig.tsindex c9320abff4a..1baa6e21e5f 100644--- a/packages/twenty-front/src/modules/client-config/hooks/useClientConfig.ts+++ b/packages/twenty-front/src/modules/client-config/hooks/useClientConfig.ts@@ -214,6 +214,7 @@ export const useClientConfig = (): UseClientConfigResult => {defaultSubdomain: clientConfig?.defaultSubdomain,frontDomain: clientConfig?.frontDomain,publicFunctionDomain: clientConfig?.publicFunctionDomain,+ serverUrl: clientConfig?.serverUrl,});setCanManageFeatureFlags(clientConfig?.canManageFeatureFlags);setLabPublicFeatureFlags(clientConfig?.publicFeatureFlags);diff --git a/packages/twenty-front/src/modules/client-config/types/ClientConfig.ts b/packages/twenty-front/src/modules/client-config/types/ClientConfig.tsindex b9ab8e3345b..230efbf36ee 100644--- a/packages/twenty-front/src/modules/client-config/types/ClientConfig.ts+++ b/packages/twenty-front/src/modules/client-config/types/ClientConfig.ts@@ -30,6 +30,7 @@ export type ClientConfig = {captcha: Captcha;defaultSubdomain?: string;frontDomain: string;+ serverUrl: string;publicFunctionDomain?: string | null;isAttachmentPreviewEnabled: boolean;isConfigVariablesInDbEnabled: boolean;diff --git a/packages/twenty-front/src/modules/client-config/utils/__tests__/clientConfigUtils.test.ts b/packages/twenty-front/src/modules/client-config/utils/__tests__/clientConfigUtils.test.tsindex ae42a7e76eb..cc62f5777d2 100644--- a/packages/twenty-front/src/modules/client-config/utils/__tests__/clientConfigUtils.test.ts+++ b/packages/twenty-front/src/modules/client-config/utils/__tests__/clientConfigUtils.test.ts@@ -21,6 +21,7 @@ const mockClientConfig = {isEmailVerificationRequired: false,defaultSubdomain: 'app',frontDomain: 'localhost',+ serverUrl: 'http://localhost:3000',support: {supportDriver: 'none',supportFrontChatId: undefined,diff --git a/packages/twenty-front/src/modules/domain-manager/states/domainConfigurationState.ts b/packages/twenty-front/src/modules/domain-manager/states/domainConfigurationState.tsindex 38eb1823cc3..b3c5351c418 100644--- a/packages/twenty-front/src/modules/domain-manager/states/domainConfigurationState.ts+++ b/packages/twenty-front/src/modules/domain-manager/states/domainConfigurationState.ts@@ -4,7 +4,7 @@ import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomStatexport const domainConfigurationState = createAtomState<Pick<ClientConfig,- 'frontDomain' | 'defaultSubdomain' | 'publicFunctionDomain'+ 'frontDomain' | 'defaultSubdomain' | 'publicFunctionDomain' | 'serverUrl'>>({key: 'domainConfiguration',@@ -12,5 +12,6 @@ export const domainConfigurationState = createAtomState<frontDomain: '',defaultSubdomain: undefined,publicFunctionDomain: undefined,+ serverUrl: '',},});diff --git a/packages/twenty-front/src/modules/navigation/components/MultiWorkspaceDropdown/__stories__/MultiWorkspaceDropdownButton.stories.tsx b/packages/twenty-front/src/modules/navigation/components/MultiWorkspaceDropdown/__stories__/MultiWorkspaceDropdownButton.stories.tsxindex 63d6eaa1024..e70bfb4473b 100644--- a/packages/twenty-front/src/modules/navigation/components/MultiWorkspaceDropdown/__stories__/MultiWorkspaceDropdownButton.stories.tsx+++ b/packages/twenty-front/src/modules/navigation/components/MultiWorkspaceDropdown/__stories__/MultiWorkspaceDropdownButton.stories.tsx@@ -71,6 +71,7 @@ const meta: Meta<typeof MultiWorkspaceDropdownButton> = {frontDomain: 'example.com',defaultSubdomain: 'app',publicFunctionDomain: undefined,+ serverUrl: 'https://api.example.com',});jotaiStore.set(availableWorkspacesState.atom, {availableWorkspacesForSignIn: AVAILABLE_WORKSPACES,diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoOidcForm.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoOidcForm.tsxindex 2c4a2088462..93fcdd7e948 100644--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoOidcForm.tsx+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoOidcForm.tsx@@ -1,5 +1,6 @@/* @license Enterprise */+import { useBuildServerUrl } from '@/settings/security/hooks/useBuildServerUrl';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { styled } from '@linaria/react';import { useLingui } from '@lingui/react/macro';@@ -8,7 +9,6 @@ import { Section } from 'twenty-ui/components/layout';import { IconCopy } from 'twenty-ui/icon';import { Button } from 'twenty-ui/primitives/input';import { themeCssVariables } from 'twenty-ui/theme';-import { REACT_APP_SERVER_BASE_URL } from '~/config';import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';const StyledInputsContainer = styled.div`@@ -38,9 +38,10 @@ export const SettingsSsoOidcForm = () => {const { control } = useFormContext();const { copyToClipboard } = useCopyToClipboard();const { t } = useLingui();+ const buildServerUrl = useBuildServerUrl();const authorizedUrl = window.location.origin;- const redirectionUrl = `${REACT_APP_SERVER_BASE_URL}/auth/oidc/callback`;+ const redirectionUrl = buildServerUrl('/auth/oidc/callback');return (<>diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsxindex a7897541477..58cfc88ea9e 100644--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx@@ -1,4 +1,5 @@import { parseSamlMetadataFromXmlFile } from '@/settings/security/utils/parseSamlMetadataFromXmlFile';+import { useBuildServerUrl } from '@/settings/security/hooks/useBuildServerUrl';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { styled } from '@linaria/react';import { useLingui } from '@lingui/react/macro';@@ -54,6 +55,7 @@ export const SettingsSsoSamlForm = () => {const { setValue, getValues, watch, trigger } = useFormContext();const { t } = useLingui();const { copyToClipboard } = useCopyToClipboard();+ const buildServerUrl = useBuildServerUrl();const handleFileChange = async (e: ChangeEvent<HTMLInputElement>) => {if (isDefined(e.target.files)) {@@ -74,8 +76,8 @@ export const SettingsSsoSamlForm = () => {}};- const entityID = `${REACT_APP_SERVER_BASE_URL}/auth/saml/login/${getValues('id')}`;- const acsUrl = `${REACT_APP_SERVER_BASE_URL}/auth/saml/callback/${getValues('id')}`;+ const entityID = buildServerUrl(`/auth/saml/login/${getValues('id')}`);+ const acsUrl = buildServerUrl(`/auth/saml/callback/${getValues('id')}`);const inputFileRef = useRef<HTMLInputElement>(null);diff --git a/packages/twenty-front/src/modules/settings/security/hooks/useBuildServerUrl.ts b/packages/twenty-front/src/modules/settings/security/hooks/useBuildServerUrl.tsnew file mode 100644index 00000000000..cde856ca27a--- /dev/null+++ b/packages/twenty-front/src/modules/settings/security/hooks/useBuildServerUrl.ts@@ -0,0 +1,15 @@+import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';+import { buildServerUrl } from '@/settings/security/utils/buildServerUrl';+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';+import { isNonEmptyString } from '@sniptt/guards';+import { REACT_APP_SERVER_BASE_URL } from '~/config';++export const useBuildServerUrl = () => {+ const { serverUrl } = useAtomStateValue(domainConfigurationState);++ const baseUrl = isNonEmptyString(serverUrl)+ ? serverUrl+ : REACT_APP_SERVER_BASE_URL;++ return (pathname: string) => buildServerUrl({ serverUrl: baseUrl, pathname });+};diff --git a/packages/twenty-front/src/modules/settings/security/utils/__tests__/buildServerUrl.test.ts b/packages/twenty-front/src/modules/settings/security/utils/__tests__/buildServerUrl.test.tsnew file mode 100644index 00000000000..a1e9ba1e87e--- /dev/null+++ b/packages/twenty-front/src/modules/settings/security/utils/__tests__/buildServerUrl.test.ts@@ -0,0 +1,30 @@+import { buildServerUrl } from '@/settings/security/utils/buildServerUrl';++describe('buildServerUrl', () => {+ it('appends the pathname to the server url', () => {+ expect(+ buildServerUrl({+ serverUrl: 'https://api.example.com',+ pathname: '/auth/saml/login/idp-id',+ }),+ ).toBe('https://api.example.com/auth/saml/login/idp-id');+ });++ it('drops a default port the way the server does', () => {+ expect(+ buildServerUrl({+ serverUrl: 'https://crm.example.com:443',+ pathname: '/auth/oidc/callback',+ }),+ ).toBe('https://crm.example.com/auth/oidc/callback');+ });++ it('replaces a path prefix instead of appending to it', () => {+ expect(+ buildServerUrl({+ serverUrl: 'https://crm.example.com/api/',+ pathname: '/auth/saml/callback/idp-id',+ }),+ ).toBe('https://crm.example.com/auth/saml/callback/idp-id');+ });+});diff --git a/packages/twenty-front/src/modules/settings/security/utils/buildServerUrl.ts b/packages/twenty-front/src/modules/settings/security/utils/buildServerUrl.tsnew file mode 100644index 00000000000..62d97ed22d5--- /dev/null+++ b/packages/twenty-front/src/modules/settings/security/utils/buildServerUrl.ts@@ -0,0 +1,13 @@+export const buildServerUrl = ({+ serverUrl,+ pathname,+}: {+ serverUrl: string;+ pathname: string;+}) => {+ const url = new URL(serverUrl);++ url.pathname = pathname;++ return url.toString();+};diff --git a/packages/twenty-front/src/testing/mock-data/config.ts b/packages/twenty-front/src/testing/mock-data/config.tsindex 01d66e7f115..efe507d61b1 100644--- a/packages/twenty-front/src/testing/mock-data/config.ts+++ b/packages/twenty-front/src/testing/mock-data/config.ts@@ -16,6 +16,7 @@ export const mockedClientConfig: ClientConfig = {sso: [],},frontDomain: 'localhost',+ serverUrl: 'http://localhost:3000',defaultSubdomain: 'app',analyticsEnabled: true,support: {diff --git a/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.spec.ts b/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.spec.tsnew file mode 100644index 00000000000..ec6cce05477--- /dev/null+++ b/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.spec.ts@@ -0,0 +1,206 @@+import { Test, type TestingModule } from '@nestjs/testing';+import { getRepositoryToken } from '@nestjs/typeorm';++import { type Response } from 'express';+import { type Repository } from 'typeorm';++import { SsoAuthController } from 'src/engine/core-modules/auth/controllers/sso-auth.controller';+import { AuthRestApiExceptionFilter } from 'src/engine/core-modules/auth/filters/auth-rest-api-exception.filter';+import { EnterpriseFeaturesEnabledGuard } from 'src/engine/core-modules/auth/guards/enterprise-features-enabled.guard';+import { OidcAuthGuard } from 'src/engine/core-modules/auth/guards/oidc-auth.guard';+import { SamlAuthGuard } from 'src/engine/core-modules/auth/guards/saml-auth.guard';+import { AuthService } from 'src/engine/core-modules/auth/services/auth.service';+import { type SamlRequest } from 'src/engine/core-modules/auth/strategies/saml.auth.strategy';+import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';+import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';+import { GuardRedirectService } from 'src/engine/core-modules/guard-redirect/services/guard-redirect.service';+import { SsoService } from 'src/engine/core-modules/sso/services/sso.service';+import {+ IdentityProviderType,+ SsoIdentityProviderStatus,+ WorkspaceSsoIdentityProviderEntity,+} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';+import { UserService } from 'src/engine/core-modules/user/services/user.service';+import { type UserEntity } from 'src/engine/core-modules/user/user.entity';+import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';+import { PublicEndpointGuard } from 'src/engine/guards/public-endpoint.guard';++const WORKSPACE_ID = 'workspace-id';+const IDENTITY_PROVIDER_ID = 'identity-provider-id';+const EMAIL = '[email protected]';++const workspace = { id: WORKSPACE_ID };++const identityProvider = {+ id: IDENTITY_PROVIDER_ID,+ type: IdentityProviderType.SAML,+ status: SsoIdentityProviderStatus.Active,+ workspaceId: WORKSPACE_ID,+ workspace,+};++const buildSamlRequest = () =>+ ({+ user: { identityProviderId: IDENTITY_PROVIDER_ID, email: EMAIL },+ }) as SamlRequest;++const buildResponse = () => ({ redirect: jest.fn() }) as unknown as Response;++describe('SsoAuthController', () => {+ let controller: SsoAuthController;+ let authService: jest.Mocked<AuthService>;+ let userService: jest.Mocked<UserService>;++ beforeEach(async () => {+ const module: TestingModule = await Test.createTestingModule({+ controllers: [SsoAuthController],+ providers: [+ {+ provide: AuthService,+ useValue: {+ findWorkspaceForSignInUp: jest.fn().mockResolvedValue(workspace),+ findInvitationForSignInUp: jest.fn().mockResolvedValue(undefined),+ formatUserDataPayload: jest.fn((newUserPayload, existingUser) => ({+ userData: existingUser+ ? { type: 'existingUser', existingUser }+ : { type: 'newUser', newUserPayload },+ })),+ checkAccessForSignIn: jest.fn().mockResolvedValue(undefined),+ signInUp: jest.fn(),+ createSsoConnectedAccountIfFeatureFlagIsOn: jest+ .fn()+ .mockResolvedValue(undefined),+ computeRedirectURI: jest.fn().mockReturnValue('https://redirect'),+ },+ },+ {+ provide: UserService,+ useValue: {+ findUserByEmail: jest.fn(),+ markEmailAsVerified: jest.fn().mockResolvedValue(undefined),+ },+ },+ {+ provide: LoginTokenService,+ useValue: {+ generateLoginToken: jest+ .fn()+ .mockResolvedValue({ token: 'login-token' }),+ },+ },+ { provide: GuardRedirectService, useValue: {} },+ { provide: WorkspaceDomainsService, useValue: {} },+ { provide: SsoService, useValue: {} },+ {+ provide: getRepositoryToken(WorkspaceSsoIdentityProviderEntity),+ useValue: {+ findOne: jest.fn().mockResolvedValue(identityProvider),+ } as Partial<Repository<WorkspaceSsoIdentityProviderEntity>>,+ },+ ],+ })+ .overrideGuard(EnterpriseFeaturesEnabledGuard)+ .useValue({ canActivate: () => true })+ .overrideGuard(SamlAuthGuard)+ .useValue({ canActivate: () => true })+ .overrideGuard(OidcAuthGuard)+ .useValue({ canActivate: () => true })+ .overrideGuard(PublicEndpointGuard)+ .useValue({ canActivate: () => true })+ .overrideGuard(NoPermissionGuard)+ .useValue({ canActivate: () => true })+ .overrideFilter(AuthRestApiExceptionFilter)+ .useValue({ catch: jest.fn() })+ .compile();++ controller = module.get(SsoAuthController);+ authService = module.get(AuthService);+ userService = module.get(UserService);+ });++ it('creates a new SSO user with an already verified email', async () => {+ const createdUser = {+ id: 'new-user-id',+ email: EMAIL,+ isEmailVerified: true,+ } as UserEntity;++ userService.findUserByEmail.mockResolvedValue(null);+ authService.signInUp.mockResolvedValue({+ workspace,+ user: createdUser,+ } as Awaited<ReturnType<AuthService['signInUp']>>);++ const response = buildResponse();++ await controller.samlAuthCallback(buildSamlRequest(), response);++ expect(authService.formatUserDataPayload).toHaveBeenCalledWith(+ expect.objectContaining({ email: EMAIL, isEmailAlreadyVerified: true }),+ null,+ );+ expect(userService.markEmailAsVerified).not.toHaveBeenCalled();+ expect(response.redirect).toHaveBeenCalledWith('https://redirect');+ });++ it('marks an existing password-less unverified user as verified after an SSO sign-in', async () => {+ const existingUser = {+ id: 'existing-user-id',+ email: EMAIL,+ isEmailVerified: false,+ passwordHash: null,+ } as unknown as UserEntity;++ userService.findUserByEmail.mockResolvedValue(existingUser);+ authService.signInUp.mockResolvedValue({+ workspace,+ user: existingUser,+ } as Awaited<ReturnType<AuthService['signInUp']>>);++ const response = buildResponse();++ await controller.samlAuthCallback(buildSamlRequest(), response);++ expect(userService.markEmailAsVerified).toHaveBeenCalledWith(+ existingUser.id,+ );+ expect(response.redirect).toHaveBeenCalledWith('https://redirect');+ });++ it('does not mark an existing unverified user who has a password', async () => {+ const existingUser = {+ id: 'existing-user-id',+ email: EMAIL,+ isEmailVerified: false,+ passwordHash: 'password-hash',+ } as UserEntity;++ userService.findUserByEmail.mockResolvedValue(existingUser);+ authService.signInUp.mockResolvedValue({+ workspace,+ user: existingUser,+ } as Awaited<ReturnType<AuthService['signInUp']>>);++ await controller.samlAuthCallback(buildSamlRequest(), buildResponse());++ expect(userService.markEmailAsVerified).not.toHaveBeenCalled();+ });++ it('does not touch an existing user whose email is already verified', async () => {+ const existingUser = {+ id: 'existing-user-id',+ email: EMAIL,+ isEmailVerified: true,+ } as UserEntity;++ userService.findUserByEmail.mockResolvedValue(existingUser);+ authService.signInUp.mockResolvedValue({+ workspace,+ user: existingUser,+ } as Awaited<ReturnType<AuthService['signInUp']>>);++ await controller.samlAuthCallback(buildSamlRequest(), buildResponse());++ expect(userService.markEmailAsVerified).not.toHaveBeenCalled();+ });+});diff --git a/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.ts b/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.tsindex d52ac9a5cf3..3c4c0491f33 100644--- a/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.ts@@ -12,6 +12,7 @@ import {import { InjectRepository } from '@nestjs/typeorm';import { generateServiceProviderMetadata } from '@node-saml/node-saml';+import { isNonEmptyString } from '@sniptt/guards';import { Response } from 'express';import {ApiPath,@@ -232,7 +233,7 @@ export class SsoAuthController {const existingUser = await this.userService.findUserByEmail(payload.email);const { userData } = this.authService.formatUserDataPayload(- payload,+ { ...payload, isEmailAlreadyVerified: true },existingUser,);@@ -252,6 +253,10 @@ export class SsoAuthController {},});+ if (!user.isEmailVerified && !isNonEmptyString(user.passwordHash)) {+ await this.userService.markEmailAsVerified(user.id);+ }+if (ssoContext) {await this.authService.createSsoConnectedAccountIfFeatureFlagIsOn({workspaceId: workspace.id,diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.controller.spec.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.controller.spec.tsindex c001460a478..04222df19db 100644--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.controller.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.controller.spec.ts@@ -71,6 +71,7 @@ describe('ClientConfigController', () => {isEmailVerificationRequired: false,defaultSubdomain: 'app',frontDomain: 'localhost',+ serverUrl: 'http://localhost:3000',publicFunctionDomain: null,support: {supportDriver: SupportDriver.NONE,diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.tsindex 683c5da1f48..42102a6ba2e 100644--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts@@ -362,6 +362,9 @@ export class ClientConfig {@Field(() => String)frontDomain: string;+ @Field(() => String)+ serverUrl: string;+@Field(() => String, { nullable: true })publicFunctionDomain: string | null;diff --git a/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.ts b/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.tsindex 0483991f326..0bdba644db0 100644--- a/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.ts+++ b/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.ts@@ -204,6 +204,7 @@ export class ClientConfigService {),defaultSubdomain: this.twentyConfigService.get('DEFAULT_SUBDOMAIN'),frontDomain: this.domainServerConfigService.getFrontUrl().hostname,+ serverUrl: this.twentyConfigService.get('SERVER_URL'),publicFunctionDomain:this.domainServerConfigService.getPublicBaseHostnameOrUndefined() ??null,