Skip to content

The open alternative to Salesforce, designed for AI.

Fix onboarding locale reverting to English after signup (#22675)

Raphaël Bosif06ba08b1625
diff --git a/packages/twenty-front/src/modules/domain-manager/hooks/useBuildSearchParamsFromUrlSyncedStates.ts b/packages/twenty-front/src/modules/domain-manager/hooks/useBuildSearchParamsFromUrlSyncedStates.ts
index 44a83f4da61..e5b92c29077 100644
--- a/packages/twenty-front/src/modules/domain-manager/hooks/useBuildSearchParamsFromUrlSyncedStates.ts
+++ b/packages/twenty-front/src/modules/domain-manager/hooks/useBuildSearchParamsFromUrlSyncedStates.ts
@@ -3,6 +3,7 @@ import { useCallback } from 'react';
import { billingCheckoutSessionState } from '@/auth/states/billingCheckoutSessionState';
import { returnToPathState } from '@/auth/states/returnToPathState';
import { BILLING_CHECKOUT_SESSION_DEFAULT_VALUE } from '@/settings/billing/constants/BillingCheckoutSessionDefaultValue';
+import { i18n } from '@lingui/core';
import { isNonEmptyString } from '@sniptt/guards';
import { useStore } from 'jotai';
@@ -19,6 +20,7 @@ export const useBuildSearchParamsFromUrlSyncedStates = () => {
}
: {}),
...(isNonEmptyString(returnToPath) ? { returnToPath } : {}),
+ ...(isNonEmptyString(i18n.locale) ? { locale: i18n.locale } : {}),
};
return output;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
index ce3083bcc9d..28d0e395192 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
@@ -398,6 +398,7 @@ export class AuthResolver {
const user = await this.signInUpService.signUpWithoutWorkspace(
{
email: signUpInput.email,
+ locale: signUpInput.locale,
},
{
provider: AuthProviderEnum.Password,
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.ts
index 3132a73cab7..2ce6cff71ad 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
@@ -974,6 +974,7 @@ export class AuthService {
lastName,
email,
picture,
+ locale,
isEmailAlreadyVerified: true,
},
{