Skip to content

The open alternative to Salesforce, designed for AI.

Add new onboarding login screen at /welcome-v2 (#22027)

Raphaël Bosi558e2e410746
diff --git a/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts b/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts
index f7115fbd8ad..9386ccec362 100644
--- a/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts
+++ b/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts
@@ -130,6 +130,16 @@ const testCases: {
{ loc: AppPath.SignInUp, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.BOOK_ONBOARDING, res: AppPath.BookCallDecision },
{ loc: AppPath.SignInUp, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: undefined },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.WorkspaceActivation },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.SYNC_EMAIL, res: AppPath.SyncEmails },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.INVITE_TEAM, res: AppPath.InviteTeam },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.BOOK_ONBOARDING, res: AppPath.BookCallDecision },
+ { loc: AppPath.SignInUpV2, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },
+
{ loc: AppPath.Invite, hasAccessTokenPair: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: '/plan-required' },
{ loc: AppPath.Invite, hasAccessTokenPair: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },
{ loc: AppPath.Invite, hasAccessTokenPair: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: undefined },
diff --git a/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx b/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx
index 90e43dca6dc..61c1ebe9728 100644
--- a/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx
+++ b/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx
@@ -253,7 +253,8 @@ export const PageChangeEffect = () => {
}
break;
}
- case isMatchingLocation(location, AppPath.SignInUp): {
+ case isMatchingLocation(location, AppPath.SignInUp):
+ case isMatchingLocation(location, AppPath.SignInUpV2): {
resetFocusStackToFocusItem({
focusStackItem: {
focusId: PageFocusId.SignInUp,
diff --git a/packages/twenty-front/src/modules/app/hooks/useCreateAppRouter.tsx b/packages/twenty-front/src/modules/app/hooks/useCreateAppRouter.tsx
index 083ea7d9f68..9c6af895f13 100644
--- a/packages/twenty-front/src/modules/app/hooks/useCreateAppRouter.tsx
+++ b/packages/twenty-front/src/modules/app/hooks/useCreateAppRouter.tsx
@@ -36,6 +36,12 @@ const SignInUp = lazy(() =>
})),
);
+const SignInUpV2 = lazy(() =>
+ import('~/pages/auth/SignInUpV2').then((module) => ({
+ default: module.SignInUpV2,
+ })),
+);
+
const PasswordReset = lazy(() =>
import('~/pages/auth/PasswordReset').then((module) => ({
default: module.PasswordReset,
@@ -257,6 +263,14 @@ export const useCreateAppRouter = (
</Route>
</Route>
<Route element={<BlankLayout />}>
+ <Route
+ path={AppPath.SignInUpV2}
+ element={
+ <LazyRoute fallback={null}>
+ <SignInUpV2 />
+ </LazyRoute>
+ }
+ />
<Route
path={AppPath.Authorize}
element={
diff --git a/packages/twenty-front/src/modules/auth/components/Logo.tsx b/packages/twenty-front/src/modules/auth/components/Logo.tsx
index 7e21eccf3af..d87338b3011 100644
--- a/packages/twenty-front/src/modules/auth/components/Logo.tsx
+++ b/packages/twenty-front/src/modules/auth/components/Logo.tsx
@@ -13,6 +13,7 @@ type LogoProps = {
secondaryLogo?: string | null;
placeholder?: string | null;
onClick?: () => void;
+ to?: AppPath;
};
const StyledContainer = styled.div`
@@ -55,6 +56,7 @@ export const Logo = ({
secondaryLogo,
placeholder,
onClick,
+ to = AppPath.SignInUp,
}: LogoProps) => {
const { redirectToDefaultDomain } = useRedirectToDefaultDomain();
const defaultPrimaryLogoUrl = `${window.location.origin}/images/icons/android/android-launchericon-192-192.png`;
@@ -76,10 +78,7 @@ export const Logo = ({
return (
<StyledContainer onClick={() => onClick?.()}>
{isUsingDefaultLogo ? (
- <UndecoratedLink
- to={AppPath.SignInUp}
- onClick={() => redirectToDefaultDomain()}
- >
+ <UndecoratedLink to={to} onClick={() => redirectToDefaultDomain()}>
<StyledPrimaryLogo
style={{ backgroundImage: `url(${primaryLogoUrl})` }}
/>
diff --git a/packages/twenty-front/src/modules/auth/constants/OngoingUserCreationPaths.ts b/packages/twenty-front/src/modules/auth/constants/OngoingUserCreationPaths.ts
index db499b4c504..4ea8ff08db5 100644
--- a/packages/twenty-front/src/modules/auth/constants/OngoingUserCreationPaths.ts
+++ b/packages/twenty-front/src/modules/auth/constants/OngoingUserCreationPaths.ts
@@ -3,6 +3,7 @@ import { AppPath } from 'twenty-shared/types';
export const ONGOING_USER_CREATION_PATHS = [
AppPath.Invite,
AppPath.SignInUp,
+ AppPath.SignInUpV2,
AppPath.VerifyEmail,
AppPath.Verify,
];
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/FooterNote.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/FooterNote.tsx
index d65c17f9153..9e843aca5fa 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/FooterNote.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/FooterNote.tsx
@@ -54,7 +54,13 @@ const StyledSeparator = styled.span`
color: ${themeCssVariables.font.color.tertiary};
`;
-export const FooterNote = () => {
+type FooterNoteProps = {
+ secondaryAgreement?: 'privacyPolicy' | 'dataProcessingAgreement';
+};
+
+export const FooterNote = ({
+ secondaryAgreement = 'privacyPolicy',
+}: FooterNoteProps) => {
const { isOnAWorkspace } = useIsCurrentLocationOnAWorkspace();
const { shouldOfferBypass, shouldUseBypass, enableBypass } =
@@ -72,13 +78,23 @@ export const FooterNote = () => {
<Trans>Terms of Service</Trans>
</a>{' '}
<Trans>and</Trans>{' '}
- <a
- href="https://twenty.com/legal/privacy"
- target="_blank"
- rel="noopener noreferrer"
- >
- <Trans>Privacy Policy</Trans>
- </a>
+ {secondaryAgreement === 'dataProcessingAgreement' ? (
+ <a
+ href="https://twenty.com/legal/dpa"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <Trans>Data Processing Agreement</Trans>
+ </a>
+ ) : (
+ <a
+ href="https://twenty.com/legal/privacy"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <Trans>Privacy Policy</Trans>
+ </a>
+ )}
.
</StyledCopyContainer>
);
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpV2StandardContent.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpV2StandardContent.tsx
new file mode 100644
index 00000000000..40427385b87
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpV2StandardContent.tsx
@@ -0,0 +1,53 @@
+import { Logo } from '@/auth/components/Logo';
+import { Title } from '@/auth/components/Title';
+import { FooterNote } from '@/auth/sign-in-up/components/FooterNote';
+import { WorkspaceSelectionFooter } from '@/auth/sign-in-up/components/WorkspaceSelectionFooter';
+import { SignInUpStep } from '@/auth/states/signInUpStepState';
+import { type JSX } from 'react';
+import { AppPath } from 'twenty-shared/types';
+import { AnimatedEaseIn } from 'twenty-ui/layout';
+import { ModalContent } from 'twenty-ui/surfaces';
+import { type PublicWorkspaceData } from '~/generated-metadata/graphql';
+
+type SignInUpV2StandardContentProps = {
+ workspacePublicData: PublicWorkspaceData | null;
+ signInUpForm: JSX.Element | null;
+ signInUpStep: SignInUpStep;
+ title: string;
+ onClickOnLogo: () => void;
+};
+
+export const SignInUpV2StandardContent = ({
+ workspacePublicData,
+ signInUpForm,
+ signInUpStep,
+ title,
+ onClickOnLogo,
+}: SignInUpV2StandardContentProps) => {
+ return (
+ <ModalContent isVerticallyCentered isHorizontallyCentered>
+ <AnimatedEaseIn>
+ <Logo
+ secondaryLogo={workspacePublicData?.logo}
+ placeholder={workspacePublicData?.displayName}
+ onClick={onClickOnLogo}
+ to={AppPath.SignInUpV2}
+ />
+ </AnimatedEaseIn>
+ <Title animate>{title}</Title>
+ {signInUpForm}
+ {signInUpStep === SignInUpStep.WorkspaceSelection && (
+ <WorkspaceSelectionFooter />
+ )}
+ {![
+ SignInUpStep.Password,
+ SignInUpStep.TwoFactorAuthenticationProvision,
+ SignInUpStep.TwoFactorAuthenticationVerification,
+ SignInUpStep.WorkspaceSelection,
+ SignInUpStep.WorkspaceCreation,
+ ].includes(signInUpStep) && (
+ <FooterNote secondaryAgreement="dataProcessingAgreement" />
+ )}
+ </ModalContent>
+ );
+};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx
index 4ab2e519e4f..7449b31a469 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx
@@ -17,11 +17,13 @@ import { Trans, useLingui } from '@lingui/react/macro';
import { OTPInput, type SlotProps } from 'input-otp';
import { useState } from 'react';
import { Controller } from 'react-hook-form';
+import { useLocation } from 'react-router-dom';
import { AppPath } from 'twenty-shared/types';
import { MainButton } from 'twenty-ui/input';
import { ClickToActionLink } from 'twenty-ui/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useNavigateApp } from '~/hooks/useNavigateApp';
+import { isMatchingLocation } from '~/utils/isMatchingLocation';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
@@ -181,6 +183,7 @@ export const SignInUpTOTPVerification = () => {
const { enqueueErrorSnackBar } = useSnackBar();
const navigate = useNavigateApp();
+ const location = useLocation();
const { readCaptchaToken } = useReadCaptchaToken();
const { isCaptchaReady } = useCaptcha();
const loginToken = useAtomStateValue(loginTokenState);
@@ -203,7 +206,11 @@ export const SignInUpTOTPVerification = () => {
const captchaToken = readCaptchaToken();
if (!loginToken) {
- return navigate(AppPath.SignInUp);
+ return navigate(
+ isMatchingLocation(location, AppPath.SignInUpV2)
+ ? AppPath.SignInUpV2
+ : AppPath.SignInUp,
+ );
}
await getAuthTokensFromOTP(values.otp, loginToken, captchaToken);
diff --git a/packages/twenty-front/src/modules/captcha/constants/CaptchaProtectedPaths.ts b/packages/twenty-front/src/modules/captcha/constants/CaptchaProtectedPaths.ts
index a48182f1452..179410fe7a7 100644
--- a/packages/twenty-front/src/modules/captcha/constants/CaptchaProtectedPaths.ts
+++ b/packages/twenty-front/src/modules/captcha/constants/CaptchaProtectedPaths.ts
@@ -2,6 +2,7 @@ import { AppPath } from 'twenty-shared/types';
export const CAPTCHA_PROTECTED_PATHS: string[] = [
AppPath.SignInUp,
+ AppPath.SignInUpV2,
AppPath.Verify,
AppPath.VerifyEmail,
AppPath.ResetPassword,
diff --git a/packages/twenty-front/src/modules/metadata-store/components/MinimalMetadataGater.tsx b/packages/twenty-front/src/modules/metadata-store/components/MinimalMetadataGater.tsx
index 393769027c5..4aa2dc8ecb5 100644
--- a/packages/twenty-front/src/modules/metadata-store/components/MinimalMetadataGater.tsx
+++ b/packages/twenty-front/src/modules/metadata-store/components/MinimalMetadataGater.tsx
@@ -19,6 +19,7 @@ export const MinimalMetadataGater = ({ children }: React.PropsWithChildren) => {
isMatchingLocation(location, AppPath.Verify) ||
isMatchingLocation(location, AppPath.VerifyEmail) ||
isMatchingLocation(location, AppPath.SignInUp) ||
+ isMatchingLocation(location, AppPath.SignInUpV2) ||
isMatchingLocation(location, AppPath.Invite) ||
isMatchingLocation(location, AppPath.ResetPassword) ||
isMatchingLocation(location, AppPath.WorkspaceActivation) ||
diff --git a/packages/twenty-front/src/pages/auth/SignInUpV2.tsx b/packages/twenty-front/src/pages/auth/SignInUpV2.tsx
new file mode 100644
index 00000000000..ed72983a843
--- /dev/null
+++ b/packages/twenty-front/src/pages/auth/SignInUpV2.tsx
@@ -0,0 +1,205 @@
+import { useSignInUp } from '@/auth/sign-in-up/hooks/useSignInUp';
+import { useSignInUpForm } from '@/auth/sign-in-up/hooks/useSignInUpForm';
+import {
+ SignInUpStep,
+ signInUpStepState,
+} from '@/auth/states/signInUpStepState';
+import { workspacePublicDataState } from '@/auth/states/workspacePublicDataState';
+import { styled } from '@linaria/react';
+
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
+
+import { EmailVerificationSent } from '@/auth/sign-in-up/components/EmailVerificationSent';
+import { SignInUpGlobalScopeForm } from '@/auth/sign-in-up/components/SignInUpGlobalScopeForm';
+import { SignInUpV2StandardContent } from '@/auth/sign-in-up/components/SignInUpV2StandardContent';
+import { SignInUpWorkspaceScopeForm } from '@/auth/sign-in-up/components/SignInUpWorkspaceScopeForm';
+import { SignInUpSSOIdentityProviderSelection } from '@/auth/sign-in-up/components/internal/SignInUpSSOIdentityProviderSelection';
+import { SignInUpWorkspaceCreationForm } from '@/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm';
+import { SignInUpWorkspaceScopeFormEffect } from '@/auth/sign-in-up/components/internal/SignInUpWorkspaceScopeFormEffect';
+import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWorkspaceEnabledState';
+import { useGetPublicWorkspaceDataByDomain } from '@/domain-manager/hooks/useGetPublicWorkspaceDataByDomain';
+import { useIsCurrentLocationOnAWorkspace } from '@/domain-manager/hooks/useIsCurrentLocationOnAWorkspace';
+import { useIsCurrentLocationOnDefaultDomain } from '@/domain-manager/hooks/useIsCurrentLocationOnDefaultDomain';
+import { useMemo } from 'react';
+
+import { SignInUpGlobalScopeFormEffect } from '@/auth/sign-in-up/components/internal/SignInUpGlobalScopeFormEffect';
+import { SignInUpTwoFactorAuthenticationProvision } from '@/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationProvision';
+import { SignInUpTOTPVerification } from '@/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification';
+import { useWorkspaceFromInviteHash } from '@/auth/sign-in-up/hooks/useWorkspaceFromInviteHash';
+import { clientConfigApiStatusState } from '@/client-config/states/clientConfigApiStatusState';
+import { ModalContent } from 'twenty-ui/surfaces';
+import { useLingui } from '@lingui/react/macro';
+import { useSearchParams } from 'react-router-dom';
+import { isDefined } from 'twenty-shared/utils';
+import { Loader } from 'twenty-ui/feedback';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+
+const StyledLoaderContainer = styled.div`
+ align-items: center;
+ display: flex;
+ justify-content: center;
+ margin-bottom: ${themeCssVariables.spacing[8]};
+ margin-top: ${themeCssVariables.spacing[8]};
+ width: 100%;
+`;
+
+const StyledBackground = styled.div`
+ background: ${themeCssVariables.background.secondary};
+ display: flex;
+ flex-direction: column;
+ height: 100dvh;
+ width: 100%;
+`;
+
+export const SignInUpV2 = () => {
+ const { t } = useLingui();
+ const setSignInUpStep = useSetAtomState(signInUpStepState);
+ const clientConfigApiStatus = useAtomStateValue(clientConfigApiStatusState);
+
+ const { form } = useSignInUpForm();
+ const { signInUpStep } = useSignInUp(form);
+ const { isDefaultDomain } = useIsCurrentLocationOnDefaultDomain();
+ const { isOnAWorkspace } = useIsCurrentLocationOnAWorkspace();
+ const workspacePublicData = useAtomStateValue(workspacePublicDataState);
+ const { loading: getPublicWorkspaceDataLoading } =
+ useGetPublicWorkspaceDataByDomain();
+ const isMultiWorkspaceEnabled = useAtomStateValue(
+ isMultiWorkspaceEnabledState,
+ );
+ const { workspaceInviteHash, workspace: workspaceFromInviteHash } =
+ useWorkspaceFromInviteHash();
+
+ const [searchParams] = useSearchParams();
+
+ const onClickOnLogo = () => {
+ setSignInUpStep(SignInUpStep.Init);
+ };
+
+ const isGlobalScope = isDefaultDomain && isMultiWorkspaceEnabled;
+
+ const title = useMemo(() => {
+ if (isDefined(workspaceInviteHash)) {
+ const workspaceName = workspaceFromInviteHash?.displayName ?? '';
+ return t`Join ${workspaceName} team`;
+ }
+
+ if (signInUpStep === SignInUpStep.WorkspaceSelection) {
+ return t`Choose a Workspace`;
+ }
+
+ if (signInUpStep === SignInUpStep.WorkspaceCreation) {
+ return t`Create your workspace`;
+ }
+
+ if (signInUpStep === SignInUpStep.TwoFactorAuthenticationProvision) {
+ return t`Setup your 2FA`;
+ }
+
+ if (signInUpStep === SignInUpStep.TwoFactorAuthenticationVerification) {
+ return t`Verify code from the app`;
+ }
+
+ if (isGlobalScope) {
+ return t`Welcome to Twenty`;
+ }
+
+ const workspaceName = workspacePublicData?.displayName;
+
+ if (!workspaceName) {
+ return t`Welcome to your workspace`;
+ }
+
+ return t`Welcome, ${workspaceName}.`;
+ }, [
+ workspaceInviteHash,
+ signInUpStep,
+ workspacePublicData?.displayName,
+ isGlobalScope,
+ t,
+ workspaceFromInviteHash?.displayName,
+ ]);
+
+ const signInUpForm = useMemo(() => {
+ if (getPublicWorkspaceDataLoading || !clientConfigApiStatus.isLoadedOnce) {
+ return (
+ <StyledLoaderContainer>
+ <Loader color="gray" />
+ </StyledLoaderContainer>
+ );
+ }
+
+ // The workspace creation form is shared by both multi-workspace and
+ // single-workspace self-host, so it must render regardless of domain or
+ // workspace scope.
+ if (signInUpStep === SignInUpStep.WorkspaceCreation) {
+ return <SignInUpWorkspaceCreationForm />;
+ }
+
+ if (isDefaultDomain && isMultiWorkspaceEnabled) {
+ return (
+ <>
+ <SignInUpGlobalScopeFormEffect />
+ <SignInUpGlobalScopeForm />
+ </>
+ );
+ }
+
+ if (
+ isOnAWorkspace &&
+ signInUpStep === SignInUpStep.SSOIdentityProviderSelection
+ ) {
+ return <SignInUpSSOIdentityProviderSelection />;
+ }
+
+ if (signInUpStep === SignInUpStep.TwoFactorAuthenticationProvision) {
+ return <SignInUpTwoFactorAuthenticationProvision />;
+ }
+
+ if (signInUpStep === SignInUpStep.TwoFactorAuthenticationVerification) {
+ return <SignInUpTOTPVerification />;
+ }
+
+ if (isDefined(workspacePublicData) && isOnAWorkspace) {
+ return (
+ <>
+ <SignInUpWorkspaceScopeFormEffect />
+ <SignInUpWorkspaceScopeForm />
+ </>
+ );
+ }
+
+ return (
+ <>
+ <SignInUpGlobalScopeFormEffect />
+ <SignInUpGlobalScopeForm />
+ </>
+ );
+ }, [
+ clientConfigApiStatus.isLoadedOnce,
+ isDefaultDomain,
+ isMultiWorkspaceEnabled,
+ isOnAWorkspace,
+ getPublicWorkspaceDataLoading,
+ signInUpStep,
+ workspacePublicData,
+ ]);
+
+ return (
+ <StyledBackground>
+ {signInUpStep === SignInUpStep.EmailVerification ? (
+ <ModalContent isVerticallyCentered isHorizontallyCentered>
+ <EmailVerificationSent email={searchParams.get('email')} />
+ </ModalContent>
+ ) : (
+ <SignInUpV2StandardContent
+ workspacePublicData={workspacePublicData}
+ signInUpForm={signInUpForm}
+ signInUpStep={signInUpStep}
+ title={title}
+ onClickOnLogo={onClickOnLogo}
+ />
+ )}
+ </StyledBackground>
+ );
+};
diff --git a/packages/twenty-front/src/pages/auth/__stories__/SignInUpV2.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/SignInUpV2.stories.tsx
new file mode 100644
index 00000000000..bc10152a292
--- /dev/null
+++ b/packages/twenty-front/src/pages/auth/__stories__/SignInUpV2.stories.tsx
@@ -0,0 +1,85 @@
+import { getOperationName } from '~/utils/getOperationName';
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { HttpResponse, graphql } from 'msw';
+import { useEffect } from 'react';
+import { fireEvent, within } from 'storybook/test';
+
+import { captchaTokenState } from '@/captcha/states/captchaTokenState';
+import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
+import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
+import {
+ PageDecorator,
+ type PageDecoratorArgs,
+} from '~/testing/decorators/PageDecorator';
+import { graphqlMocks } from '~/testing/graphqlMocks';
+
+import { AppPath } from 'twenty-shared/types';
+import { SignInUpV2 } from '~/pages/auth/SignInUpV2';
+
+const CaptchaTokenSetterEffect = () => {
+ const setCaptchaToken = useSetAtomState(captchaTokenState);
+
+ useEffect(() => {
+ setCaptchaToken('MOCKED_CAPTCHA_TOKEN');
+ }, [setCaptchaToken]);
+
+ return null;
+};
+
+const SignInUpV2WithCaptcha = () => {
+ return (
+ <>
+ <CaptchaTokenSetterEffect />
+ <SignInUpV2 />
+ </>
+ );
+};
+
+const meta: Meta<PageDecoratorArgs> = {
+ title: 'Pages/Auth/SignInUpV2',
+ component: SignInUpV2WithCaptcha,
+ decorators: [PageDecorator],
+ args: { routePath: AppPath.SignInUpV2 },
+ parameters: {
+ msw: {
+ handlers: [
+ graphql.query(getOperationName(GET_CURRENT_USER) ?? '', () => {
+ return HttpResponse.json({
+ data: null,
+ errors: [
+ {
+ message: 'Unauthorized',
+ extensions: {
+ code: 'UNAUTHENTICATED',
+ response: {
+ statusCode: 401,
+ message: 'Unauthorized',
+ },
+ },
+ },
+ ],
+ });
+ }),
+ graphqlMocks.handlers,
+ ],
+ },
+ cookie: '',
+ },
+};
+
+export default meta;
+
+export type Story = StoryObj<typeof SignInUpV2WithCaptcha>;
+
+export const Default: Story = {
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement.ownerDocument.body);
+ const continueWithEmailButton = await canvas.findByText(
+ 'Continue with Email',
+ {},
+ { timeout: 3000 },
+ );
+
+ await fireEvent.click(continueWithEmailButton);
+ },
+};
diff --git a/packages/twenty-front/src/utils/title-utils.ts b/packages/twenty-front/src/utils/title-utils.ts
index 0d54fb9a666..7b5d6fd9a5b 100644
--- a/packages/twenty-front/src/utils/title-utils.ts
+++ b/packages/twenty-front/src/utils/title-utils.ts
@@ -29,6 +29,7 @@ export const getPageTitleFromPath = (pathname: string): string => {
case AppPath.Verify:
return t`Verify`;
case AppPath.SignInUp:
+ case AppPath.SignInUpV2:
return t`Sign in or Create an account`;
case AppPath.Invite:
return t`Invite`;
diff --git a/packages/twenty-shared/src/types/AppPath.ts b/packages/twenty-shared/src/types/AppPath.ts
index 8d9a12a2739..e9fbec6e660 100644
--- a/packages/twenty-shared/src/types/AppPath.ts
+++ b/packages/twenty-shared/src/types/AppPath.ts
@@ -3,6 +3,7 @@ export enum AppPath {
Verify = '/verify',
VerifyEmail = '/verify-email',
SignInUp = '/welcome',
+ SignInUpV2 = '/welcome-v2',
Invite = '/invite/:workspaceInviteHash',
ResetPassword = '/reset-password/:passwordResetToken',