Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(auth): remove auth variants (#81763)

Fernando Gomes455f11a993c7
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 6d25b627a5ca..bc57de430e62 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -7846,66 +7846,6 @@ snapshots:
hash: v1.k794b7964.674e5a613b6d3f2933862db144b0fab805875bfb9926e2f1f49e502c375363f5.KcBmjEDBWtXtN_WsV0TL9ePVzhfYEyfr4qrLBdoyGyM
scenes-other-integration-landing-page--not-connected--light:
hash: v1.k794b7964.fe31b9b4308a40ebe93aaf37ac256bc1a21917798708dada68092982307706ac.AaXZuU22qSzLFz9K3r7uKn1dFqRUC5CwW2v3u3R-z6A
- scenes-other-invitesignup--cloud--dark:
- hash: v1.k794b7964.9c70f4fe88faeec4aa965da2e709e0c280257173236a00470581eb72ead0730b.k6WHxlxSY5tnERc4hJE2SqPO-hZjLeAfgoAbccg576E
- scenes-other-invitesignup--cloud--light:
- hash: v1.k794b7964.81f5a665de20393870330beb53550a85165fd9874b5d7dd1e184e0f23a7d4492.G5IIB099TmgJ7Ep2uP_Ek-IEx3q8jJzI4XolrJQrfMI
- scenes-other-invitesignup--cloud-eu--dark:
- hash: v1.k794b7964.9c70f4fe88faeec4aa965da2e709e0c280257173236a00470581eb72ead0730b.63t0RlAlT0bpsZNi5gT46pDNzLhT9t8_XoMw6LqHXcw
- scenes-other-invitesignup--cloud-eu--light:
- hash: v1.k794b7964.81f5a665de20393870330beb53550a85165fd9874b5d7dd1e184e0f23a7d4492.jXEPnUTAKAhhkVlTU9pp9XGnPt3jO-phG5OGD-zhfTI
- scenes-other-invitesignup--invalid-link--dark:
- hash: v1.k794b7964.cea0308bcaa33ed5eed68a00b2ac8ecb86658f97aa525843d8dda9c0dad6084d.NHJAeobEBIUSxmxrw0CmBFNxVkkcB1V-sHfuqotXNm4
- scenes-other-invitesignup--invalid-link--light:
- hash: v1.k794b7964.82e54d898ac353ebdfb33bae9b07805510906e6336027f9ee831e1a0b39014f1.BazrEO3JPG2CT-Q-N4q30-XdblI_yL78sXUTT28VImc
- scenes-other-invitesignup--logged-in--dark:
- hash: v1.k794b7964.643cd560af1cb722d7df7bff3bd2b526cad39cb1c9f44dfba2b6195baddd6469.vXO1IqymVjafEYGZZBJ8PM7ZHdlrqU1hhkcUiKc2kfs
- scenes-other-invitesignup--logged-in--light:
- hash: v1.k794b7964.a009f7a330dd7549859bcbd052353366fcbb3de8220cd486fdd739936d1962e0.XDJ_KcUsIkiBz1nCf5ksNCFHaLT7_atiUIRGHxVKJgA
- scenes-other-invitesignup--logged-in-wrong-user--dark:
- hash: v1.k794b7964.5712f19d6307e6684cb031817220d80f566bffbb985292b18476039783f68928.Jthjr0rFg7MIeas4R9vGZqpZpbpk5nWaOmEb0qJwVyA
- scenes-other-invitesignup--logged-in-wrong-user--light:
- hash: v1.k794b7964.03cc599181ee3bdaf20f1fcfb029339c8070dd651873ddca7d6cdc841e2e28fb.Wsa7OacVqKU-o1vSuZtlEJ4fovgWQQxIn7S5YfvLFGY
- scenes-other-invitesignup--self-hosted--dark:
- hash: v1.k794b7964.06fab3e7e5672837fcf542c94acfe35747ff61497c0b58a5305732c23e41ae16.R_3MuvfO6W8DPxUWDxSz6dPSlK_IpNNXNQ8Q1d2BHBk
- scenes-other-invitesignup--self-hosted--light:
- hash: v1.k794b7964.4bdd045a22ae313fbff2af3fe86008266662e3ef1b0a816bb25aebd9de315d96.JzwaxWGvLqEXldhzf2Y5opJSEpOFqcoRUBn2n75mJQI
- scenes-other-invitesignup--sso-enforced-google--dark:
- hash: v1.k794b7964.935e35e511472d1ef19c89d2fe724f6ad1ebf5593460c012e2c50894f447af06.pmw_p8bGv5n0ISh22ZbI8g2ZlNpTJPaAZmeRzaBxAZw
- scenes-other-invitesignup--sso-enforced-google--light:
- hash: v1.k794b7964.61b16c5bdcd0ccb9d789901a8077bfd81456daf0ce7fe3dd21b7cc79f10f0a80.2CfkF8zdkrZ1tppsjrSNcdwlVEOtUf56SxihV_U32No
- scenes-other-invitesignup--sso-enforced-saml--dark:
- hash: v1.k794b7964.9714db8e0679793e27629f7b3543b4a1d0ed5340b9c4939a88913f0ac9892873.HynJiWx3WkMk4Eezv3-0JFUOuNw4Cdan18uzM_MAwLU
- scenes-other-invitesignup--sso-enforced-saml--light:
- hash: v1.k794b7964.d4851dd118032b9b9831351ae5c3aff3c2f59bd53ea1ffd278fe0df357ec873f.XJSL9ZuKAGZHeEqRmjSC7IBR6fk7gQPAalqsxtfKgvg
- scenes-other-login--cloud--dark:
- hash: v1.k794b7964.11cc61785d357aa15b9505aba4f4a8d240c212c9f87bae75aefd2d016d5506fe.fJO0jHhAK0h7oYkGPg5aLTtD63J8IbazmOXohwAs9W0
- scenes-other-login--cloud--light:
- hash: v1.k794b7964.b1dcd3927c950d1727691e8b0d0dd9e76686437514d8611def688dbe6a215015.j2NVaCafJGGOOQNA6Q2qFEBm9o2VAPxHSz71lLJzitk
- scenes-other-login--cloud-eu--dark:
- hash: v1.k794b7964.11cc61785d357aa15b9505aba4f4a8d240c212c9f87bae75aefd2d016d5506fe.pp0ThlHIxhRFIEItpbXT26tfU8avQiv7Xq3uO0I33n0
- scenes-other-login--cloud-eu--light:
- hash: v1.k794b7964.b1dcd3927c950d1727691e8b0d0dd9e76686437514d8611def688dbe6a215015.8mzXmoq2IxI_Yqy1bX6L2beB-zevc_GKFufUpUfztns
- scenes-other-login--cloud-with-google-login-enforcement--dark:
- hash: v1.k794b7964.f4873e54563f2d7f76071bf2b48d480e8f05865947f3413810aaff5d722653de.SWYg9-7dqrOolu-Gl_3KCNkea1cx_7wxeDLWv7SXBJY
- scenes-other-login--cloud-with-google-login-enforcement--light:
- hash: v1.k794b7964.27666a057f6e90bb221574cf92625e0c5917af108a027d67d22f44faff6e741b.eEsXfEXS7oaBOhqWJajIJMc5mGNzau0h931EIFpUPsw
- scenes-other-login--second-factor--dark:
- hash: v1.k794b7964.05d74bd05dc7684e33f58d96b1b18cefcd27385d21bd6222991cb37e701f41f8.tdh2im65iL3WkqA9wnXKkr4nVxsaZAGxPy08UTcsnyk
- scenes-other-login--second-factor--light:
- hash: v1.k794b7964.03efc9770e4bb3149cb2c321c2ecfbfb28d21282a4e5c18cda760b2d7e289a30.efuJC861QQoNY2rBEOQAZFlrkf42AU_QznVrD1Cb-Nw
- scenes-other-login--self-hosted--dark:
- hash: v1.k794b7964.dd0be1f5697769ff5c17995db5a015de43b5080107b664a9fbe0acb9a00b9737.vZ3lbsy93J1-qDntrnHY5Xn15P3jbaS72NckVN2L1oI
- scenes-other-login--self-hosted--light:
- hash: v1.k794b7964.23dc5811b4d5ab2de76c31dc3fea70aec40b41411d804eb81e40886059b51ae3.dv7ADtNoAVJKVHDFQus3LV_SwX_owfq7msB7NmsktJo
- scenes-other-login--self-hosted-with-saml--dark:
- hash: v1.k794b7964.d420074b0ec346b7d3fb9542b9deef9e0f2d78908495707d6280f19d717e08ee.cTtwFczfUEKAge97wYGtoUxZ-X18zWb9K3HfdVZTV7s
- scenes-other-login--self-hosted-with-saml--light:
- hash: v1.k794b7964.85ec2dd27a6c1026c805d93f2f07c9da7d7fffdc70b6cec66d18a67b8dcd67c0.nu4PExZBRikK4rdA4Oyv5U0jaF_9lTVKai2lJ5lpBD4
- scenes-other-login--sso-error--dark:
- hash: v1.k794b7964.74f6b06befabb9a40b42d0fd9dcc2f5aa79000700dad94c775ee5296919efea3.8JWbggLS8K9zvSJVp-iPHM5ooB2UENgH4eGnF_y_ezY
- scenes-other-login--sso-error--light:
- hash: v1.k794b7964.dcb9dbd028e9325ec079706aaf108c905d2d6116d8fcbef7482d48f370cda6a1.IpTMqWIuRh6xGrQ4TzU6wCvTIYdToc9T6wkqkOenjSY
scenes-other-onboarding-legacy--ai-observability-sdk-install--dark:
hash: v1.k794b7964.0c82a4b8b276a3f51b42dd3a20aed7672fbfb5f096e4bd9da51221b6eb52bbdc.iXUjftr_vTAULjZ_soSDjZ9o_RG2YPlJBCG4ZSuNTS0
scenes-other-onboarding-legacy--ai-observability-sdk-install--light:
@@ -8214,18 +8154,6 @@ snapshots:
hash: v1.k794b7964.5de3e955f865fa9301e3e3e7a1cd018790e74f18b3aec241c4164549eaa2ad68.rsccvu79W2TIlGdjUPSc6M0r4sz5rF5MX7rHkJOkFA4
scenes-other-settings-organization-oauth-apps--with-apps--light:
hash: v1.k794b7964.b205875d375c5a66196e4ad55b794f719e0f8d98e3e5f7838da6f8e846294194.d6wj83uWgchZ8z3T8PNbeKl1NaCAhZFiVOm2hF6qKsk
- scenes-other-signup--cloud--dark:
- hash: v1.k794b7964.63b7a569a69b73aad46b1d578ad10991ba00bbc11ea8836a0d18fc04a82781dc.5aFLOjyAEnvDQheeu76uInEBEqiyoir7R-qPIIrMOp4
- scenes-other-signup--cloud--light:
- hash: v1.k794b7964.a45baf69dbd597572ca0c053148890eb78370ed4f2e20b29d4399a3e18e3e71c.eKQYqun1VoCG4SGursB7gYxnqf7aWsRQVjzUyUt26S0
- scenes-other-signup--self-hosted--dark:
- hash: v1.k794b7964.0d4b7af69732e3d91ca3df3254e0dfb54eaedad2cffbb951cfbae5684c42a4d2.M_8SM_ILHOiFZqTI6H1zvCJC8-MWS9wH4VKW-ZaEkbw
- scenes-other-signup--self-hosted--light:
- hash: v1.k794b7964.34cfcea37e0f5190f5a360cba2651e4f7a3feacb3325556d4f2707f2cc3253e6.q2c9n0Qgn-jF27KPzXd4dmsnbFEZPn9OAe0HlZjx1_g
- scenes-other-signup--self-hosted-sso--dark:
- hash: v1.k794b7964.13d89ad313c8b7e7d8076ebe99c9f879f6da893ec4f003812cb32edd65a53bf7.d-BPApDnbOEXwJKzNBl0ECJlB6wa7y18G6la72ArWXM
- scenes-other-signup--self-hosted-sso--light:
- hash: v1.k794b7964.ca03495adc3b8d6d2c87e4cb14853cea28be9a3733d63065bf93c56cf1a4129e.SVQpnL6FTaa-j77LPWsLi8po1QG3RoTDdtS2vHeyB5M
scenes-other-toolbar--actions--dark:
hash: v1.k794b7964.0705132dd6b4cbf90f20ecbac58fce46946ee0700a063443c1e7f30105e6d23e.3l1620osQ1jKD_SJoZ2myZACS0SGDb5jerGaxB8rULM
scenes-other-toolbar--actions--light:
@@ -8322,22 +8250,6 @@ snapshots:
hash: v1.k794b7964.e75d32ee685dc6ca84cabbcdee6f0a8b6e676e098ec0970c3f40238eb63d2505.POz79bVIYS0jPbfMdP-EyhgiPeNDn9PIH2L_V-hvkLM
scenes-other-unsubscribe--unsubscribe-scene--light:
hash: v1.k794b7964.32a495f27332766c8518281776aefd55f9735198498e2085607c5e31d485ee6c.2Nq1SK6bbI-ldCdtItLnJiYz0e5xrwvcDk_O7L7G9xQ
- scenes-other-verify-email--verify-email-invalid--dark:
- hash: v1.k794b7964.922371f06db3afa85790ff288212e7ef338062ff9f500b35a18f0f42974d5060.7v2k_-XnR9kw9koVkcw8J1_A-YRu8xXCcnzda8Yvr0g
- scenes-other-verify-email--verify-email-invalid--light:
- hash: v1.k794b7964.9bac7c543ad78b6d8086c8c183b89bf9ea7c8955335e2eb1324ff43bf5fa312b.PKvQ33JbawzkRo1wgVVA4RTvOJ0uum6lP4r5YA2Y65I
- scenes-other-verify-email--verify-email-pending--dark:
- hash: v1.k794b7964.2700adf93c0db866ecdb65bebe14eed9d25d354bcca7719a4d0cf0b483db9c13.1Wbu43rV3nF37hqOYq9RwViur8DAceAv7NeeeU5k7HE
- scenes-other-verify-email--verify-email-pending--light:
- hash: v1.k794b7964.a32707477a77bbd7b763aff2033cfbf255dee8e848c42a8234d899738fb0260a.BODBEgZFTQGkpDR1U4boy9Jyje6f-6jwa0GI6XS52So
- scenes-other-verify-email--verify-email-success--dark:
- hash: v1.k794b7964.3cd9ec9eccdf5e0ee71ee86a1ce306d8e7a3e8a95fd099392b5dbe2e9f7641dc.tOrteaM3xWBuaLtT3KT8QSO_iFl_vHt7blluDRhroBY
- scenes-other-verify-email--verify-email-success--light:
- hash: v1.k794b7964.fe7ee841f2ab7352104a4b4accfe7a0b94f3389aff653963e1645cd83bf2939b.IZrHDOncAO2piudam4TS0l_Du3qfOXXMDSFglVeVN6A
- scenes-other-verify-email--verifying-email--dark:
- hash: v1.k794b7964.3e87b6b8fab1359b96b346bcf645e8e1a6814591098fa8ab6109a20205b20388.skX3tYGro6Unwii2hdl-WEsi3fc93g4eDOWGf1OUhtA
- scenes-other-verify-email--verifying-email--light:
- hash: v1.k794b7964.4d711e0e271b7bddd6510a451366d589620a63bce471ddaf9c19b6ce20146891.fVzplWlyNZ1CNLLXaBKa8sGNdIEiPAuxkRwSP43eK68
scenes-other-welcome-dialog--default--dark:
hash: v1.k794b7964.78805404c7984295f1b22a3434b629f234052e61b824079c2d3dc20a405a29b2.8Lra1rJtS38B89clX5En0KuShHaXR62OYOOH9VMkbpw
scenes-other-welcome-dialog--default--light:
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 9c715e17608d..fb633aa3c07d 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -187,7 +187,6 @@ export const FEATURE_FLAGS = {
AI_OBSERVABILITY_SELF_DRIVING: 'ai-observability-daily-digest-scout', // owner: #team-ai-observability, gates the AI observability Self-driving tab
AI_TRAINING: 'ai-training', // owner: @nicowaltz #team-replay #ai-research, gates the AI training opt-out UI and API enforcement
AUDIT_LOGS_ACCESS: 'audit-logs-access', // owner: #team-platform-features, used to control access to audit logs
- AUTH_FLOW_VARIANT: 'auth-flow-variant', // owner: @fercgomes #team-growth multivariate=legacy,paper-desk,glass; selects the auth flow experience across login, signup, invited signup, and email verification
BATCH_EXPORT_EARLIEST_BACKFILL: 'batch-export-earliest-backfill', // owner: #team-batch-exports, allow backfilling from beginning of time
CONTROL_SUPPORT_LOGIN: 'control_support_login', // owner: #team-security, used to control whether users can opt out of support impersonation
CUSTOM_CSS_THEMES: 'custom-css-themes', // owner: #team-growth, used to enable custom CSS for teams who want to have fun
diff --git a/frontend/src/scenes/appScenes.ts b/frontend/src/scenes/appScenes.ts
index 6eac63a86083..68c4718a3adf 100644
--- a/frontend/src/scenes/appScenes.ts
+++ b/frontend/src/scenes/appScenes.ts
@@ -107,7 +107,7 @@ export const appScenes: Record<Scene | string, () => any> = {
import('scenes/web-analytics/SessionAttributionExplorer/SessionAttributionExplorerScene'),
[Scene.SessionProfile]: () => import('./sessions/SessionProfileScene'),
[Scene.Settings]: () => import('./settings/SettingsScene'),
- [Scene.Signup]: () => import('./authentication/signup/SignupContainer'),
+ [Scene.Signup]: () => import('./authentication/signup/Signup'),
[Scene.Site]: () => import('./sites/Site'),
[Scene.StartupProgram]: () => import('./startups/StartupProgram'),
[Scene.Survey]: () => import('./surveys/Survey'),
diff --git a/frontend/src/scenes/authentication/authFlowVariantRegistry.tsx b/frontend/src/scenes/authentication/authFlowVariantRegistry.tsx
deleted file mode 100644
index d1e8d7577ea7..000000000000
--- a/frontend/src/scenes/authentication/authFlowVariantRegistry.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import type { AuthFlowVariant } from './authFlowVariants'
-import { GlassInviteSignup } from './invite-signup/variants/glass/GlassInviteSignup'
-import { LegacyInviteSignup } from './invite-signup/variants/legacy/LegacyInviteSignup'
-import { PaperDeskInviteSignup } from './invite-signup/variants/paper-desk/PaperDeskInviteSignup'
-import { GlassLogin } from './login/variants/glass/GlassLogin'
-import { LegacyLogin } from './login/variants/legacy/LegacyLogin'
-import { PaperDeskLogin } from './login/variants/paper-desk/PaperDeskLogin'
-import { GlassSignup } from './signup/variants/glass/GlassSignup'
-import { LegacySignup } from './signup/variants/legacy/LegacySignup'
-import { PaperDeskSignup } from './signup/variants/paper-desk/PaperDeskSignup'
-import { GlassVerifyEmail } from './verify-email/variants/glass/GlassVerifyEmail'
-import { LegacyVerifyEmail } from './verify-email/variants/legacy/LegacyVerifyEmail'
-import { PaperDeskVerifyEmail } from './verify-email/variants/paper-desk/PaperDeskVerifyEmail'
-
-interface AuthFlowVariantComponents {
- Login: () => JSX.Element | null
- Signup: () => JSX.Element | null
- InviteSignup: () => JSX.Element | null
- VerifyEmail: () => JSX.Element | null
-}
-
-// One variant value selects every auth-flow screen together: login, signup, invited signup and email verification.
-export const authFlowVariantRegistry: Record<AuthFlowVariant, AuthFlowVariantComponents> = {
- legacy: {
- Login: LegacyLogin,
- Signup: LegacySignup,
- InviteSignup: LegacyInviteSignup,
- VerifyEmail: LegacyVerifyEmail,
- },
- 'paper-desk': {
- Login: PaperDeskLogin,
- Signup: PaperDeskSignup,
- InviteSignup: PaperDeskInviteSignup,
- VerifyEmail: PaperDeskVerifyEmail,
- },
- glass: {
- Login: GlassLogin,
- Signup: GlassSignup,
- InviteSignup: GlassInviteSignup,
- VerifyEmail: GlassVerifyEmail,
- },
-}
diff --git a/frontend/src/scenes/authentication/authFlowVariants.ts b/frontend/src/scenes/authentication/authFlowVariants.ts
deleted file mode 100644
index d3a0e2fc5476..000000000000
--- a/frontend/src/scenes/authentication/authFlowVariants.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { FEATURE_FLAGS } from 'lib/constants'
-import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
-
-export type AuthFlowVariant = 'legacy' | 'paper-desk' | 'glass'
-
-const DEFAULT_VARIANT: AuthFlowVariant = 'legacy'
-
-export const AUTH_FLOW_VARIANTS: AuthFlowVariant[] = ['legacy', 'paper-desk', 'glass']
-
-export function resolveAuthFlowVariant(featureFlags: FeatureFlagsSet): AuthFlowVariant {
- const variant = featureFlags[FEATURE_FLAGS.AUTH_FLOW_VARIANT]
- return typeof variant === 'string' && (AUTH_FLOW_VARIANTS as string[]).includes(variant)
- ? (variant as AuthFlowVariant)
- : DEFAULT_VARIANT
-}
diff --git a/frontend/src/scenes/authentication/invite-signup/GlassInviteSignup.stories.tsx b/frontend/src/scenes/authentication/invite-signup/GlassInviteSignup.stories.tsx
deleted file mode 100644
index ec007ee94626..000000000000
--- a/frontend/src/scenes/authentication/invite-signup/GlassInviteSignup.stories.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import type { Meta, StoryFn } from '@storybook/react'
-import { HttpResponse, delay } from 'msw'
-import { useEffect } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
-
-import { mswDecorator, useStorybookMocks } from '~/mocks/browser'
-import preflightJson from '~/mocks/fixtures/_preflight.json'
-
-import { InviteSignup } from './InviteSignup'
-import { inviteSignupLogic } from './inviteSignupLogic'
-
-const MOCK_INVITE_ID = '1234'
-
-type StoryArgs = {
- scenario: 'new-user' | 'existing-account' | 'invalid-link'
- cloud: boolean
- googleOAuth: boolean
- github: boolean
- gitlab: boolean
- ssoEnforcement: 'none' | 'google-oauth2' | 'github' | 'gitlab' | 'saml'
-}
-
-const meta: Meta<StoryArgs> = {
- title: 'Scenes-Other/Invite Signup (glass)',
- tags: ['test-skip'],
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'glass' },
- },
- decorators: [
- mswDecorator({
- get: {
- [`/api/signup/${MOCK_INVITE_ID}/`]: () => [
- 200,
- {
- id: MOCK_INVITE_ID,
- target_email: '[email protected]',
- first_name: 'Jane Doe',
- organization_name: 'Acme Corp',
- },
- ],
- '/api/signup/not-found/': () => [404, { detail: 'Invite not found or already used.' }],
- },
- post: {
- '/api/signup': async () => {
- await delay(1000)
- return HttpResponse.json({ success: true })
- },
- [`/api/signup/${MOCK_INVITE_ID}`]: async () => {
- await delay(1000)
- return HttpResponse.json({ success: true })
- },
- },
- }),
- ],
- argTypes: {
- scenario: {
- control: 'select',
- name: 'Scenario',
- options: ['new-user', 'existing-account', 'invalid-link'],
- },
- cloud: { control: 'boolean', name: 'Cloud' },
- googleOAuth: { control: 'boolean', name: 'Google OAuth' },
- github: { control: 'boolean', name: 'GitHub' },
- gitlab: { control: 'boolean', name: 'GitLab' },
- ssoEnforcement: {
- control: 'select',
- name: 'SSO enforcement',
- options: ['none', 'google-oauth2', 'github', 'gitlab', 'saml'],
- },
- },
- args: {
- scenario: 'new-user',
- cloud: true,
- googleOAuth: true,
- github: true,
- gitlab: true,
- ssoEnforcement: 'none',
- },
-}
-export default meta
-
-const Template: StoryFn<StoryArgs> = ({ scenario, cloud, googleOAuth, github, gitlab, ssoEnforcement }) => {
- const enforcement = ssoEnforcement === 'none' ? null : ssoEnforcement
- const isExistingAccount = scenario === 'existing-account'
- const inviteId = scenario === 'invalid-link' ? 'not-found' : MOCK_INVITE_ID
-
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud,
- realm: cloud ? 'cloud' : 'hosted-clickhouse',
- is_debug: cloud,
- can_create_org: cloud,
- available_social_auth_providers: {
- 'google-oauth2': googleOAuth,
- github,
- gitlab,
- saml: false,
- },
- },
- '/api/users/@me': isExistingAccount
- ? () => [200, { email: '[email protected]', first_name: 'Jane Doe', organization: { name: 'Acme Corp' } }]
- : () => [500, null],
- },
- post: {
- '/api/login/precheck': { sso_enforcement: enforcement, saml_available: false },
- },
- })
-
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite(inviteId)
- })
-
- useEffect(() => {
- if (enforcement) {
- inviteSignupLogic.actions.prevalidateInvite(inviteId)
- }
- }, [enforcement, inviteId])
-
- return <InviteSignup />
-}
-
-export const Default: StoryFn<StoryArgs> = Template.bind({})
-
-export const NewUserCloud: StoryFn<StoryArgs> = Template.bind({})
-NewUserCloud.args = { scenario: 'new-user', cloud: true }
-
-export const NewUserSelfHosted: StoryFn<StoryArgs> = Template.bind({})
-NewUserSelfHosted.args = {
- scenario: 'new-user',
- cloud: false,
- googleOAuth: false,
- github: false,
- gitlab: false,
-}
-
-export const ExistingAccount: StoryFn<StoryArgs> = Template.bind({})
-ExistingAccount.args = { scenario: 'existing-account' }
-
-export const InvalidLink: StoryFn<StoryArgs> = Template.bind({})
-InvalidLink.args = { scenario: 'invalid-link' }
-
-export const SSOEnforced: StoryFn<StoryArgs> = Template.bind({})
-SSOEnforced.args = { ssoEnforcement: 'google-oauth2' }
diff --git a/frontend/src/scenes/authentication/invite-signup/InviteSignup.stories.tsx b/frontend/src/scenes/authentication/invite-signup/InviteSignup.stories.tsx
index 103437d5b4a0..fd37a48463b3 100644
--- a/frontend/src/scenes/authentication/invite-signup/InviteSignup.stories.tsx
+++ b/frontend/src/scenes/authentication/invite-signup/InviteSignup.stories.tsx
@@ -1,5 +1,6 @@
-import { Meta, StoryObj } from '@storybook/react'
+import type { Meta, StoryFn } from '@storybook/react'
import { HttpResponse, delay } from 'msw'
+import { useEffect } from 'react'
import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
@@ -9,8 +10,20 @@ import preflightJson from '~/mocks/fixtures/_preflight.json'
import { InviteSignup } from './InviteSignup'
import { inviteSignupLogic } from './inviteSignupLogic'
-const meta: Meta = {
- title: 'Scenes-Other/InviteSignup',
+const MOCK_INVITE_ID = '1234'
+
+type StoryArgs = {
+ scenario: 'new-user' | 'existing-account' | 'invalid-link'
+ cloud: boolean
+ googleOAuth: boolean
+ github: boolean
+ gitlab: boolean
+ ssoEnforcement: 'none' | 'google-oauth2' | 'github' | 'gitlab' | 'saml'
+}
+
+const meta: Meta<StoryArgs> = {
+ title: 'Scenes-Other/Invite Signup',
+ tags: ['test-skip'],
parameters: {
layout: 'fullscreen',
viewMode: 'story',
@@ -18,239 +31,117 @@ const meta: Meta = {
decorators: [
mswDecorator({
get: {
- '/api/users/@me': () => [500, null],
- '/api/signup/1234/': () => [
+ [`/api/signup/${MOCK_INVITE_ID}/`]: () => [
200,
{
- id: '1234',
- target_email: 'b*@posthog.com',
+ id: MOCK_INVITE_ID,
+ target_email: '[email protected]',
first_name: 'Jane Doe',
- organization_name: 'PostHog',
+ organization_name: 'Acme Corp',
},
],
+ '/api/signup/not-found/': () => [404, { detail: 'Invite not found or already used.' }],
},
post: {
'/api/signup': async () => {
await delay(1000)
return HttpResponse.json({ success: true })
},
- '/api/signup/1234': async () => {
+ [`/api/signup/${MOCK_INVITE_ID}`]: async () => {
await delay(1000)
return HttpResponse.json({ success: true })
},
- '/api/login/precheck': { sso_enforcement: null, saml_available: false },
},
}),
],
-}
-export default meta
-
-type Story = StoryObj<{}>
-
-export const SelfHosted: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: false,
- realm: 'hosted-clickhouse',
- available_social_auth_providers: {
- github: false,
- gitlab: false,
- 'google-oauth2': false,
- saml: false,
- },
- },
- },
- })
-
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite('1234')
- })
-
- return <InviteSignup />
+ argTypes: {
+ scenario: {
+ control: 'select',
+ name: 'Scenario',
+ options: ['new-user', 'existing-account', 'invalid-link'],
+ },
+ cloud: { control: 'boolean', name: 'Cloud' },
+ googleOAuth: { control: 'boolean', name: 'Google OAuth' },
+ github: { control: 'boolean', name: 'GitHub' },
+ gitlab: { control: 'boolean', name: 'GitLab' },
+ ssoEnforcement: {
+ control: 'select',
+ name: 'SSO enforcement',
+ options: ['none', 'google-oauth2', 'github', 'gitlab', 'saml'],
+ },
},
-}
-
-export const Cloud: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- realm: 'cloud',
- can_create_org: true,
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: false },
- },
- },
- })
-
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite('1234')
- })
-
- return <InviteSignup />
- },
-}
-
-export const CloudEU: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- region: 'EU',
- realm: 'cloud',
- can_create_org: true,
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: false },
- },
- },
- })
-
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite('1234')
- })
-
- return <InviteSignup />
- },
-}
-
-export const InvalidLink: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- realm: 'cloud',
- can_create_org: true,
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: false },
- },
- },
- })
-
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite('not-found')
- })
-
- return <InviteSignup />
- },
-}
-
-export const LoggedIn: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- realm: 'cloud',
- can_create_org: true,
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: false },
- },
- '/api/users/@me': () => [
- 200,
- {
- email: '[email protected]',
- first_name: 'Ben White',
- organization: {
- name: 'Other org',
- },
- },
- ],
- },
- })
-
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite('1234')
- })
-
- return <InviteSignup />
+ args: {
+ scenario: 'new-user',
+ cloud: true,
+ googleOAuth: true,
+ github: true,
+ gitlab: true,
+ ssoEnforcement: 'none',
},
}
+export default meta
-export const LoggedInWrongUser: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- realm: 'cloud',
- can_create_org: true,
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: false },
+const Template: StoryFn<StoryArgs> = ({ scenario, cloud, googleOAuth, github, gitlab, ssoEnforcement }) => {
+ const enforcement = ssoEnforcement === 'none' ? null : ssoEnforcement
+ const isExistingAccount = scenario === 'existing-account'
+ const inviteId = scenario === 'invalid-link' ? 'not-found' : MOCK_INVITE_ID
+
+ useStorybookMocks({
+ get: {
+ '/_preflight': {
+ ...preflightJson,
+ cloud,
+ realm: cloud ? 'cloud' : 'hosted-clickhouse',
+ is_debug: cloud,
+ can_create_org: cloud,
+ available_social_auth_providers: {
+ 'google-oauth2': googleOAuth,
+ github,
+ gitlab,
+ saml: false,
},
- '/api/users/@me': () => [
- 200,
- {
- email: '[email protected]',
- first_name: 'Ben White',
- organization: {
- name: 'Other org',
- },
- },
- ],
- '/api/signup/1234/': () => [
- 400,
- {
- code: 'invalid_recipient',
- },
- ],
},
- })
-
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite('1234')
- })
-
- return (
- <div>
- <div className="border-b border-t p-4 font-bold">HEADER AREA</div>
- <InviteSignup />
- </div>
- )
- },
+ '/api/users/@me': isExistingAccount
+ ? () => [200, { email: '[email protected]', first_name: 'Jane Doe', organization: { name: 'Acme Corp' } }]
+ : () => [500, null],
+ },
+ post: {
+ '/api/login/precheck': { sso_enforcement: enforcement, saml_available: false },
+ },
+ })
+
+ useDelayedOnMountEffect(() => {
+ inviteSignupLogic.actions.prevalidateInvite(inviteId)
+ })
+
+ useEffect(() => {
+ if (enforcement) {
+ inviteSignupLogic.actions.prevalidateInvite(inviteId)
+ }
+ }, [enforcement, inviteId])
+
+ return <InviteSignup />
}
-export const SSOEnforcedSaml: Story = {
- render: () => {
- useStorybookMocks({
- post: {
- '/api/login/precheck': { sso_enforcement: 'saml', saml_available: true },
- },
- })
+export const Default: StoryFn<StoryArgs> = Template.bind({})
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite('1234')
- })
+export const NewUserCloud: StoryFn<StoryArgs> = Template.bind({})
+NewUserCloud.args = { scenario: 'new-user', cloud: true }
- return (
- <div>
- <div className="border-b border-t p-4 font-bold">HEADER AREA</div>
- <InviteSignup />
- </div>
- )
- },
+export const NewUserSelfHosted: StoryFn<StoryArgs> = Template.bind({})
+NewUserSelfHosted.args = {
+ scenario: 'new-user',
+ cloud: false,
+ googleOAuth: false,
+ github: false,
+ gitlab: false,
}
-export const SSOEnforcedGoogle: Story = {
- render: () => {
- useStorybookMocks({
- post: { '/api/login/precheck': { sso_enforcement: 'google-oauth2', saml_available: false } },
- })
+export const ExistingAccount: StoryFn<StoryArgs> = Template.bind({})
+ExistingAccount.args = { scenario: 'existing-account' }
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite('1234')
- })
+export const InvalidLink: StoryFn<StoryArgs> = Template.bind({})
+InvalidLink.args = { scenario: 'invalid-link' }
- return (
- <div>
- <div className="border-b border-t p-4 font-bold">HEADER AREA</div>
- <InviteSignup />
- </div>
- )
- },
-}
+export const SSOEnforced: StoryFn<StoryArgs> = Template.bind({})
+SSOEnforced.args = { ssoEnforcement: 'google-oauth2' }
diff --git a/frontend/src/scenes/authentication/invite-signup/InviteSignup.tsx b/frontend/src/scenes/authentication/invite-signup/InviteSignup.tsx
index 41a9a6e76fec..dfa9b42b9432 100644
--- a/frontend/src/scenes/authentication/invite-signup/InviteSignup.tsx
+++ b/frontend/src/scenes/authentication/invite-signup/InviteSignup.tsx
@@ -1,10 +1,6 @@
-import { useValues } from 'kea'
-
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { SceneExport } from 'scenes/sceneTypes'
-import { authFlowVariantRegistry } from '../authFlowVariantRegistry'
-import { resolveAuthFlowVariant } from '../authFlowVariants'
+import { InviteSignupForm } from './InviteSignupForm'
import { inviteSignupLogic } from './inviteSignupLogic'
export const scene: SceneExport = {
@@ -13,7 +9,5 @@ export const scene: SceneExport = {
}
export function InviteSignup(): JSX.Element {
- const { featureFlags } = useValues(featureFlagLogic)
- const { InviteSignup: VariantInviteSignup } = authFlowVariantRegistry[resolveAuthFlowVariant(featureFlags)]
- return <VariantInviteSignup />
+ return <InviteSignupForm />
}
diff --git a/frontend/src/scenes/authentication/invite-signup/variants/paper-desk/PaperDeskInviteSignup.tsx b/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
similarity index 93%
rename from frontend/src/scenes/authentication/invite-signup/variants/paper-desk/PaperDeskInviteSignup.tsx
rename to frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
index bcfe8d86081a..778aeccf909a 100644
--- a/frontend/src/scenes/authentication/invite-signup/variants/paper-desk/PaperDeskInviteSignup.tsx
+++ b/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
@@ -20,9 +20,9 @@ import { Link } from 'lib/lemon-ui/Link'
import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture'
import { SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner'
import { loginLogic } from 'scenes/authentication/login/loginLogic'
-import { CardTitle } from 'scenes/authentication/shared/paperDesk/CardTitle'
-import { OrgTile } from 'scenes/authentication/shared/paperDesk/OrgTile'
-import { PaperDeskCard, PaperDeskScene } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
+import { OrgTile } from 'scenes/authentication/shared/authScene/OrgTile'
import { TurnstileChallenge } from 'scenes/authentication/signup/signupForm/TurnstileChallenge'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { urls } from 'scenes/urls'
@@ -30,7 +30,7 @@ import { userLogic } from 'scenes/userLogic'
import { PrevalidatedInvite, SSOProvider } from '~/types'
-import { ErrorCodes, inviteSignupLogic } from '../../inviteSignupLogic'
+import { ErrorCodes, inviteSignupLogic } from './inviteSignupLogic'
const HedgehogJudge = pngHoggie(judgePng)
@@ -118,7 +118,7 @@ function InviteNewUser({ invite }: { invite: PrevalidatedInvite }): JSX.Element
<div className="flex flex-col gap-3 items-center mb-5">
<div className="flex gap-3 items-center">
<OrgTile name={org} />
- <span className="PaperDesk__inviteHeader-mark inline-flex opacity-90">
+ <span className="AuthScene__inviteHeader-mark inline-flex opacity-90">
<Logomark variant="gradient" size="md" />
</span>
</div>
@@ -134,7 +134,7 @@ function InviteNewUser({ invite }: { invite: PrevalidatedInvite }): JSX.Element
const footer = (
<>
- <p className="PaperDesk__terms mt-5 mb-0 text-xs leading-relaxed text-tertiary text-center">
+ <p className="AuthScene__terms mt-5 mb-0 text-xs leading-relaxed text-tertiary text-center">
By continuing you agree to our{' '}
<Link to="https://posthog.com/terms" target="_blank">
terms
@@ -158,9 +158,9 @@ function InviteNewUser({ invite }: { invite: PrevalidatedInvite }): JSX.Element
)
return (
- <PaperDeskScene notes={["// you've been invited", `// ${org.toLowerCase()} is waiting`]}>
- <PaperDeskCard top={inviteHeader} footer={footer}>
- <CardTitle title="Create your account" sub="Your teammates are already in. This takes a minute." />
+ <AuthScene notes={["// you've been invited", `// ${org.toLowerCase()} is waiting`]}>
+ <AuthSceneCard top={inviteHeader} footer={footer}>
+ <AuthCardTitle title="Create your account" sub="Your teammates are already in. This takes a minute." />
{signupManualErrors?.generic && (
<div className="mb-4 py-2.5 px-3 text-sm leading-normal text-primary text-left bg-danger-highlight border border-danger rounded">
{signupManualErrors.generic.detail || 'Could not complete your signup.'}{' '}
@@ -276,8 +276,8 @@ function InviteNewUser({ invite }: { invite: PrevalidatedInvite }): JSX.Element
passkeyRegistering={isPasskeyRegistering}
/>
)}
- </PaperDeskCard>
- </PaperDeskScene>
+ </AuthSceneCard>
+ </AuthScene>
)
}
@@ -288,12 +288,12 @@ function InviteExistingAccount({ invite }: { invite: PrevalidatedInvite }): JSX.
const org = invite.organization_name
return (
- <PaperDeskScene notes={['// hey, welcome back', '// one more org for you']}>
- <PaperDeskCard>
+ <AuthScene notes={['// hey, welcome back', '// one more org for you']}>
+ <AuthSceneCard>
<div className="mb-4 flex justify-center">
<OrgTile name={org} />
</div>
- <CardTitle
+ <AuthCardTitle
title={`Join ${org}`}
sub="You'll accept this invite with your existing PostHog account:"
className="mb-4"
@@ -312,7 +312,7 @@ function InviteExistingAccount({ invite }: { invite: PrevalidatedInvite }): JSX.
</div>
</div>
)}
- <p className="PaperDesk__sub mb-4 text-left text-sm text-secondary text-pretty">
+ <p className="AuthScene__sub mb-4 text-left text-sm text-secondary text-pretty">
Accepting adds <b className="text-primary">{org}</b> to your account. Switch between organizations
any time from the upper left of the app.
</p>
@@ -352,8 +352,8 @@ function InviteExistingAccount({ invite }: { invite: PrevalidatedInvite }): JSX.
</LemonButton>
</div>
)}
- </PaperDeskCard>
- </PaperDeskScene>
+ </AuthSceneCard>
+ </AuthScene>
)
}
@@ -436,14 +436,14 @@ function InviteInvalid(): JSX.Element {
)
return (
- <PaperDeskScene notes={['// hmm', "// this invite isn't right"]}>
- <PaperDeskCard footer={footer}>
+ <AuthScene notes={['// hmm', "// this invite isn't right"]}>
+ <AuthSceneCard footer={footer}>
<div className="flex flex-col items-center text-center">
<HedgehogJudge className="block w-auto mx-auto h-28" />
<h1 className="m-0 mt-3 font-title text-2xl font-extrabold leading-tight text-primary text-center tracking-tight">
{titles[code]}
</h1>
- <p className="PaperDesk__sub mt-2 mb-4 text-sm text-secondary text-center text-pretty">
+ <p className="AuthScene__sub mt-2 mb-4 text-sm text-secondary text-center text-pretty">
{details[code]}
</p>
<div className="flex flex-col gap-2.5 w-full">
@@ -468,12 +468,12 @@ function InviteInvalid(): JSX.Element {
</LemonButton>
</div>
</div>
- </PaperDeskCard>
- </PaperDeskScene>
+ </AuthSceneCard>
+ </AuthScene>
)
}
-function InviteSignup(): JSX.Element {
+export function InviteSignupForm(): JSX.Element {
const { invite, inviteLoading, error } = useValues(inviteSignupLogic)
const { user } = useValues(userLogic)
@@ -488,5 +488,3 @@ function InviteSignup(): JSX.Element {
}
return <SpinnerOverlay sceneLevel />
}
-
-export { InviteSignup as PaperDeskInviteSignup }
diff --git a/frontend/src/scenes/authentication/invite-signup/PaperDeskInviteSignup.stories.tsx b/frontend/src/scenes/authentication/invite-signup/PaperDeskInviteSignup.stories.tsx
deleted file mode 100644
index 61e415209df1..000000000000
--- a/frontend/src/scenes/authentication/invite-signup/PaperDeskInviteSignup.stories.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import type { Meta, StoryFn } from '@storybook/react'
-import { HttpResponse, delay } from 'msw'
-import { useEffect } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
-
-import { mswDecorator, useStorybookMocks } from '~/mocks/browser'
-import preflightJson from '~/mocks/fixtures/_preflight.json'
-
-import { InviteSignup } from './InviteSignup'
-import { inviteSignupLogic } from './inviteSignupLogic'
-
-const MOCK_INVITE_ID = '1234'
-
-type StoryArgs = {
- scenario: 'new-user' | 'existing-account' | 'invalid-link'
- cloud: boolean
- googleOAuth: boolean
- github: boolean
- gitlab: boolean
- ssoEnforcement: 'none' | 'google-oauth2' | 'github' | 'gitlab' | 'saml'
-}
-
-const meta: Meta<StoryArgs> = {
- title: 'Scenes-Other/Invite Signup (paper-desk)',
- tags: ['test-skip'],
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'paper-desk' },
- },
- decorators: [
- mswDecorator({
- get: {
- [`/api/signup/${MOCK_INVITE_ID}/`]: () => [
- 200,
- {
- id: MOCK_INVITE_ID,
- target_email: '[email protected]',
- first_name: 'Jane Doe',
- organization_name: 'Acme Corp',
- },
- ],
- '/api/signup/not-found/': () => [404, { detail: 'Invite not found or already used.' }],
- },
- post: {
- '/api/signup': async () => {
- await delay(1000)
- return HttpResponse.json({ success: true })
- },
- [`/api/signup/${MOCK_INVITE_ID}`]: async () => {
- await delay(1000)
- return HttpResponse.json({ success: true })
- },
- },
- }),
- ],
- argTypes: {
- scenario: {
- control: 'select',
- name: 'Scenario',
- options: ['new-user', 'existing-account', 'invalid-link'],
- },
- cloud: { control: 'boolean', name: 'Cloud' },
- googleOAuth: { control: 'boolean', name: 'Google OAuth' },
- github: { control: 'boolean', name: 'GitHub' },
- gitlab: { control: 'boolean', name: 'GitLab' },
- ssoEnforcement: {
- control: 'select',
- name: 'SSO enforcement',
- options: ['none', 'google-oauth2', 'github', 'gitlab', 'saml'],
- },
- },
- args: {
- scenario: 'new-user',
- cloud: true,
- googleOAuth: true,
- github: true,
- gitlab: true,
- ssoEnforcement: 'none',
- },
-}
-export default meta
-
-const Template: StoryFn<StoryArgs> = ({ scenario, cloud, googleOAuth, github, gitlab, ssoEnforcement }) => {
- const enforcement = ssoEnforcement === 'none' ? null : ssoEnforcement
- const isExistingAccount = scenario === 'existing-account'
- const inviteId = scenario === 'invalid-link' ? 'not-found' : MOCK_INVITE_ID
-
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud,
- realm: cloud ? 'cloud' : 'hosted-clickhouse',
- is_debug: cloud,
- can_create_org: cloud,
- available_social_auth_providers: {
- 'google-oauth2': googleOAuth,
- github,
- gitlab,
- saml: false,
- },
- },
- '/api/users/@me': isExistingAccount
- ? () => [200, { email: '[email protected]', first_name: 'Jane Doe', organization: { name: 'Acme Corp' } }]
- : () => [500, null],
- },
- post: {
- '/api/login/precheck': { sso_enforcement: enforcement, saml_available: false },
- },
- })
-
- useDelayedOnMountEffect(() => {
- inviteSignupLogic.actions.prevalidateInvite(inviteId)
- })
-
- useEffect(() => {
- if (enforcement) {
- inviteSignupLogic.actions.prevalidateInvite(inviteId)
- }
- }, [enforcement, inviteId])
-
- return <InviteSignup />
-}
-
-export const Default: StoryFn<StoryArgs> = Template.bind({})
-
-export const NewUserCloud: StoryFn<StoryArgs> = Template.bind({})
-NewUserCloud.args = { scenario: 'new-user', cloud: true }
-
-export const NewUserSelfHosted: StoryFn<StoryArgs> = Template.bind({})
-NewUserSelfHosted.args = {
- scenario: 'new-user',
- cloud: false,
- googleOAuth: false,
- github: false,
- gitlab: false,
-}
-
-export const ExistingAccount: StoryFn<StoryArgs> = Template.bind({})
-ExistingAccount.args = { scenario: 'existing-account' }
-
-export const InvalidLink: StoryFn<StoryArgs> = Template.bind({})
-InvalidLink.args = { scenario: 'invalid-link' }
-
-export const SSOEnforced: StoryFn<StoryArgs> = Template.bind({})
-SSOEnforced.args = { ssoEnforcement: 'google-oauth2' }
diff --git a/frontend/src/scenes/authentication/invite-signup/variants/glass/GlassInviteSignup.tsx b/frontend/src/scenes/authentication/invite-signup/variants/glass/GlassInviteSignup.tsx
deleted file mode 100644
index 1514e8350d96..000000000000
--- a/frontend/src/scenes/authentication/invite-signup/variants/glass/GlassInviteSignup.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { PaperDeskThemeProvider } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'
-
-import { PaperDeskInviteSignup } from '../paper-desk/PaperDeskInviteSignup'
-
-/** The paper-desk page re-skinned with posthog.com's garden design language - behavior unchanged. */
-export function GlassInviteSignup(): JSX.Element {
- return (
- <PaperDeskThemeProvider theme="glass">
- <PaperDeskInviteSignup />
- </PaperDeskThemeProvider>
- )
-}
diff --git a/frontend/src/scenes/authentication/invite-signup/variants/legacy/LegacyInviteSignup.tsx b/frontend/src/scenes/authentication/invite-signup/variants/legacy/LegacyInviteSignup.tsx
deleted file mode 100644
index 5bc037fd01cc..000000000000
--- a/frontend/src/scenes/authentication/invite-signup/variants/legacy/LegacyInviteSignup.tsx
+++ /dev/null
@@ -1,432 +0,0 @@
-import clsx from 'clsx'
-import { useActions, useValues } from 'kea'
-import { Form } from 'kea-forms'
-import { useEffect } from 'react'
-
-import { IconChevronLeft, IconChevronRight } from '@posthog/icons'
-import { LemonButton, LemonDivider, LemonInput } from '@posthog/lemon-ui'
-
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import PasswordStrength from 'lib/components/PasswordStrength'
-import SignupRoleSelect from 'lib/components/SignupRoleSelect'
-import passkeyLogo from 'lib/components/SocialLoginButton/passkey.svg'
-import { SSOEnforcedLoginButton, SocialLoginButtons } from 'lib/components/SocialLoginButton/SocialLoginButton'
-import { supportLogic } from 'lib/components/Support/supportLogic'
-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
-import { LemonField } from 'lib/lemon-ui/LemonField'
-import { Link } from 'lib/lemon-ui/Link'
-import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture'
-import { SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner'
-import { loginLogic } from 'scenes/authentication/login/loginLogic'
-import { SupportModalButton } from 'scenes/authentication/shared/SupportModalButton'
-import { TurnstileChallenge } from 'scenes/authentication/signup/signupForm/TurnstileChallenge'
-import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
-import { urls } from 'scenes/urls'
-import { userLogic } from 'scenes/userLogic'
-
-import { PrevalidatedInvite } from '~/types'
-
-import { ErrorCodes, inviteSignupLogic } from '../../inviteSignupLogic'
-
-const UTM_TAGS = 'utm_medium=in-product&utm_campaign=invite-signup'
-
-interface ErrorMessage {
- title: string
- detail: JSX.Element | string
- actions: JSX.Element
-}
-
-function HelperLinks(): JSX.Element {
- return (
- <div className="font-bold text-center">
- <Link to="/">App Home</Link>
- <span className="mx-2">|</span>
- <Link to={`https://posthog.com?${UTM_TAGS}&utm_message=invalid-invite`}>PostHog Website</Link>
- </div>
- )
-}
-
-function BackToPostHog(): JSX.Element {
- return (
- <LemonButton type="secondary" icon={<IconChevronLeft />} center fullWidth to={urls.default()}>
- Go back to PostHog
- </LemonButton>
- )
-}
-
-function ErrorView(): JSX.Element | null {
- const { error } = useValues(inviteSignupLogic)
- const { user } = useValues(userLogic)
-
- const ErrorMessages: Record<ErrorCodes, ErrorMessage> = {
- [ErrorCodes.InvalidInvite]: {
- title: 'Oops! This invite link is invalid or has expired',
- detail: (
- <>
- {error?.detail} If you believe this is a mistake, please contact whoever created this invite and{' '}
- <b>ask them for a new invite</b>.
- </>
- ),
- actions: user ? <BackToPostHog /> : <HelperLinks />,
- },
- [ErrorCodes.UserAlreadyMember]: {
- title: "You're already a member of this organization",
- detail: (
- <>
- {error?.detail || 'You already are a member of this organization.'} You can't accept this invitation
- because your account ({user?.email}) already belongs to it. If you meant to join a different
- organization, ask the inviter to send a new invite to a different email address.
- </>
- ),
- actions: user ? <BackToPostHog /> : <HelperLinks />,
- },
- [ErrorCodes.InvalidRecipient]: {
- title: "Oops! This invite link can't be used",
- detail: (
- <>
- <div>{error?.detail}</div>
- <div className="mt-4">
- {user ? (
- <span>
- You can either log out and create a new account under the new email address or ask the
- organization admin to send a{' '}
- <b>new invite to the email address on your account, {user?.email}</b>.
- </span>
- ) : (
- <div>
- You need to log in with the email address above, or create your own password.
- <div className="mt-4">
- <LemonButton
- icon={<IconChevronLeft />}
- to={window.location.pathname}
- disableClientSideRouting
- >
- Try again
- </LemonButton>
- </div>
- </div>
- )}
- </div>
- </>
- ),
- actions: user ? <BackToPostHog /> : <HelperLinks />,
- },
- [ErrorCodes.Unknown]: {
- title: 'Oops! We could not validate this invite link',
- detail: `${
- error?.detail || ''
- } There was an issue with your invite link, please try again in a few seconds. If the problem persists, contact us.`,
- actions: user ? <BackToPostHog /> : <HelperLinks />,
- },
- }
-
- if (!error) {
- return null
- }
-
- return (
- <BridgePage view="signup-error" footer={<SupportModalButton />}>
- <h2>{ErrorMessages[error.code].title}</h2>
- <div className="error-message">{ErrorMessages[error.code].detail}</div>
- <LemonDivider dashed className="my-4" />
- <div>{ErrorMessages[error.code].actions}</div>
- </BridgePage>
- )
-}
-
-function AuthenticatedAcceptInvite({ invite }: { invite: PrevalidatedInvite }): JSX.Element {
- const { user } = useValues(userLogic)
- const { acceptInvite } = useActions(inviteSignupLogic)
- const { acceptedInviteLoading, acceptedInvite } = useValues(inviteSignupLogic)
-
- return (
- <BridgePage view="accept-invite" footer={<SupportModalButton name={user?.first_name} email={user?.email} />}>
- <div className="deprecated-space-y-2">
- <h2>You have been invited to join {invite.organization_name}</h2>
- <div>
- You will accept the invite under your <b>existing PostHog account</b>:
- </div>
- {user && (
- <div
- className="border rounded-lg border-dashed flex items-center gap-2 px-2 py-1"
- data-attr="accept-invite-whoami"
- >
- <ProfilePicture user={user} />
- <div>
- <div className="font-bold">{user.first_name}</div>
- <div>{user.email}</div>
- </div>
- </div>
- )}
- <div>
- Accepting will add <b>{invite.organization_name}</b> to your account. You can switch between
- organizations at any time using the organization selector in the top-left of the navigation bar.
- </div>
- <div>
- {!acceptedInvite ? (
- <>
- <LemonButton
- type="primary"
- center
- fullWidth
- onClick={acceptInvite}
- loading={acceptedInviteLoading}
- >
- Accept invite
- </LemonButton>
- <div className="mt-2">
- <LemonButton type="secondary" center fullWidth icon={<IconChevronLeft />} to="/">
- Go back to PostHog
- </LemonButton>
- </div>
- </>
- ) : (
- <LemonButton
- type="secondary"
- center
- fullWidth
- sideIcon={<IconChevronRight />}
- onClick={() => (window.location.href = '/')}
- >
- Go to PostHog
- </LemonButton>
- )}
- </div>
- </div>
- </BridgePage>
- )
-}
-
-function UnauthenticatedAcceptInvite({ invite }: { invite: PrevalidatedInvite }): JSX.Element {
- const {
- isSignupSubmitting,
- validatedPassword,
- signupManualErrors,
- passkeyRegistered,
- isPasskeyRegistering,
- passkeyError,
- challengeRequired,
- turnstileSiteKey,
- turnstileToken,
- } = useValues(inviteSignupLogic)
- const { registerPasskey, setTurnstileToken } = useActions(inviteSignupLogic)
- const { preflight } = useValues(preflightLogic)
- const { openSupportForm } = useActions(supportLogic)
-
- const { precheck } = useActions(loginLogic)
- const { precheckResponse, precheckResponseLoading } = useValues(loginLogic)
-
- const areExtraFieldsHidden = precheckResponse.sso_enforcement
-
- useEffect(() => {
- precheck({ email: invite.target_email })
- }, [invite.target_email]) // oxlint-disable-line react-hooks/exhaustive-deps
-
- return (
- <BridgePage
- view="invites-signup"
- leftContainerContent={
- <div className="mb-8 text-secondary">
- <div className="font-semibold flex flex-col gap-2 text-center items-center text-lg">
- <span>You've been invited to join</span>
- <span className="text-4xl font-bold border-b border-dashed pb-2">
- {invite?.organization_name || 'us'}
- </span>
- <span>on PostHog</span>
- </div>
- </div>
- }
- footer={<SupportModalButton name={invite.first_name} email={invite.target_email} />}
- >
- <h2 className="text-center">Create your PostHog account</h2>
- {signupManualErrors?.generic && (
- <LemonBanner type="error" className="mb-4">
- {signupManualErrors.generic.detail || 'Could not complete your signup.'}{' '}
- {preflight?.cloud && (
- <Link
- data-attr="invite-signup-error-contact-support"
- onClick={(e) => {
- e.preventDefault()
- openSupportForm({
- kind: 'support',
- email: invite.target_email,
- })
- }}
- >
- Need help?
- </Link>
- )}
- </LemonBanner>
- )}
- {passkeyError && (
- <LemonBanner type="error" className="mb-4">
- {passkeyError}
- </LemonBanner>
- )}
- <Form logic={inviteSignupLogic} formKey="signup" className="deprecated-space-y-4" enableFormOnSubmit>
- <LemonField.Pure label="Email">
- <LemonInput type="email" disabled value={invite?.target_email} />
- </LemonField.Pure>
- {!areExtraFieldsHidden && (
- <>
- {passkeyRegistered ? (
- <div className="bg-surface-secondary rounded-lg p-4 text-center">
- <img src={passkeyLogo} alt="Passkey" className="w-8 h-8 mx-auto mb-2" />
- <p className="font-semibold mb-1">Passkey registered successfully!</p>
- <p className="text-sm text-muted">
- Complete the form below and press "Continue" to create your account.
- </p>
- </div>
- ) : (
- <>
- <LemonButton
- fullWidth
- type="secondary"
- center
- size="large"
- icon={<img src={passkeyLogo} alt="Passkey" className="object-contain w-7 h-7" />}
- onClick={registerPasskey}
- loading={isPasskeyRegistering}
- disabled={isPasskeyRegistering}
- data-attr="invite-signup-passkey"
- >
- Sign up with passkey
- </LemonButton>
- <div className="flex items-center gap-3 my-4">
- <div className="flex-1 border-t border-border" />
- <span className="text-secondary text-sm">or use a password</span>
- <div className="flex-1 border-t border-border" />
- </div>
- </>
- )}
- {!passkeyRegistered && (
- <LemonField
- name="password"
- label={
- <div className="flex flex-1 items-center justify-between">
- <span>Password</span>
- <PasswordStrength validatedPassword={validatedPassword} />
- </div>
- }
- >
- <LemonInput
- type="password"
- className="ph-ignore-input"
- data-attr="password"
- placeholder="••••••••••"
- autoComplete="new-password"
- disabled={isSignupSubmitting || passkeyRegistered}
- />
- </LemonField>
- )}
-
- <LemonField
- name="first_name"
- label="First Name"
- help={
- invite?.first_name
- ? 'Your name was provided in the invite, feel free to change it.'
- : undefined
- }
- >
- <LemonInput data-attr="first_name" placeholder="Jane" />
- </LemonField>
-
- <SignupRoleSelect />
- </>
- )}
-
- {/* Show regular login button if SSO is not enforced */}
- {!precheckResponse.sso_enforcement &&
- (challengeRequired && turnstileSiteKey ? (
- <TurnstileChallenge
- siteKey={turnstileSiteKey}
- onSuccess={setTurnstileToken}
- tokenReceived={!!turnstileToken}
- email={invite.target_email}
- />
- ) : (
- <LemonButton
- type="primary"
- status="alt"
- htmlType="submit"
- data-attr="password-signup"
- fullWidth
- center
- loading={isSignupSubmitting || precheckResponseLoading}
- size="large"
- >
- Continue
- </LemonButton>
- ))}
-
- {/* Show enforced SSO button if required */}
- {precheckResponse.sso_enforcement && (
- <SSOEnforcedLoginButton
- provider={precheckResponse.sso_enforcement}
- email={invite?.target_email}
- actionText="Continue"
- extraQueryParams={invite ? { invite_id: invite.id } : undefined}
- />
- )}
-
- {/* Show optional SAML SSO button if available */}
- {precheckResponse.saml_available && !precheckResponse.sso_enforcement && (
- <SSOEnforcedLoginButton
- provider="saml"
- email={invite?.target_email}
- actionText="Continue"
- extraQueryParams={invite ? { invite_id: invite.id } : undefined}
- />
- )}
- </Form>
- <div className="mt-4 text-center text-secondary">
- Already have an account? <Link to="/login">Log in</Link>
- </div>
- <div className="mt-4 text-center text-secondary">
- By clicking continue you agree to our{' '}
- <Link to="https://posthog.com/terms" target="_blank">
- Terms of Service
- </Link>{' '}
- and{' '}
- <Link to="https://posthog.com/privacy" target="_blank">
- Privacy Policy
- </Link>
- .
- </div>
- {!areExtraFieldsHidden && (
- <SocialLoginButtons
- className="mb-4"
- title="Or sign in with"
- caption={`Remember to log in with ${invite?.target_email}`}
- captionLocation="bottom"
- topDivider
- extraQueryParams={invite ? { invite_id: invite.id } : undefined}
- />
- )}
- </BridgePage>
- )
-}
-
-function InviteSignup(): JSX.Element {
- const { invite, inviteLoading } = useValues(inviteSignupLogic)
- const { user } = useValues(userLogic)
-
- if (inviteLoading) {
- return <SpinnerOverlay sceneLevel />
- }
-
- return (
- <div className={clsx('InviteSignup', !!user && 'InviteSignup--authenticated')}>
- <ErrorView />
- {invite &&
- (user ? (
- <AuthenticatedAcceptInvite invite={invite} />
- ) : (
- <UnauthenticatedAcceptInvite invite={invite} />
- ))}
- </div>
- )
-}
-
-export { InviteSignup as LegacyInviteSignup }
diff --git a/frontend/src/scenes/authentication/login/GlassLogin.stories.tsx b/frontend/src/scenes/authentication/login/GlassLogin.stories.tsx
deleted file mode 100644
index d14875f54820..000000000000
--- a/frontend/src/scenes/authentication/login/GlassLogin.stories.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import type { Meta, StoryFn } from '@storybook/react'
-import { useEffect } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-
-import { useStorybookMocks } from '~/mocks/browser'
-import preflightJson from '~/mocks/fixtures/_preflight.json'
-
-import { Login } from './Login'
-import { loginLogic } from './loginLogic'
-
-type StoryArgs = {
- cloud: boolean
- region: 'US' | 'EU'
- googleOAuth: boolean
- github: boolean
- gitlab: boolean
- samlAvailable: boolean
- ssoEnforcement: 'none' | 'google-oauth2' | 'github' | 'gitlab' | 'saml'
- generalError: 'none' | 'invalid_credentials' | 'code_based_verification_sent'
-}
-
-const meta: Meta<StoryArgs> = {
- title: 'Scenes-Other/Login (glass)',
- tags: ['test-skip'],
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'glass' },
- },
- argTypes: {
- cloud: { control: 'boolean', name: 'Cloud' },
- region: { control: 'select', options: ['US', 'EU'], name: 'Region', if: { arg: 'cloud' } },
- googleOAuth: { control: 'boolean', name: 'Google OAuth' },
- github: { control: 'boolean', name: 'GitHub' },
- gitlab: { control: 'boolean', name: 'GitLab' },
- samlAvailable: { control: 'boolean', name: 'SAML available' },
- ssoEnforcement: {
- control: 'select',
- name: 'SSO enforcement',
- options: ['none', 'google-oauth2', 'github', 'gitlab', 'saml'],
- },
- generalError: {
- control: 'select',
- name: 'General error',
- options: ['none', 'invalid_credentials', 'code_based_verification_sent'],
- },
- },
- args: {
- cloud: true,
- region: 'US',
- googleOAuth: true,
- github: true,
- gitlab: true,
- samlAvailable: false,
- ssoEnforcement: 'none',
- generalError: 'none',
- },
-}
-export default meta
-
-const Template: StoryFn<StoryArgs> = ({
- cloud,
- region,
- googleOAuth,
- github,
- gitlab,
- samlAvailable,
- ssoEnforcement,
- generalError,
-}) => {
- const enforcement = ssoEnforcement === 'none' ? null : ssoEnforcement
-
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud,
- region: cloud ? region : undefined,
- realm: cloud ? 'cloud' : 'hosted-clickhouse',
- is_debug: cloud,
- can_create_org: cloud,
- available_social_auth_providers: {
- 'google-oauth2': googleOAuth,
- github,
- gitlab,
- saml: samlAvailable,
- },
- },
- },
- post: {
- '/api/login/precheck': { sso_enforcement: enforcement, saml_available: samlAvailable },
- },
- })
-
- useEffect(() => {
- if (enforcement) {
- loginLogic.actions.setLoginValue('email', '[email protected]')
- loginLogic.actions.precheck({ email: '[email protected]' })
- }
- }, [enforcement])
-
- useEffect(() => {
- if (generalError !== 'none') {
- const messages: Record<string, string> = {
- invalid_credentials: 'Invalid email or password.',
- code_based_verification_sent: 'Check your email to verify your account.',
- }
- loginLogic.actions.setGeneralError(generalError, messages[generalError] ?? '')
- } else {
- loginLogic.actions.clearGeneralError()
- }
- }, [generalError])
-
- return <Login />
-}
-
-export const Default: StoryFn<StoryArgs> = Template.bind({})
-
-export const SelfHosted: StoryFn<StoryArgs> = Template.bind({})
-SelfHosted.args = { cloud: false, googleOAuth: false, github: false, gitlab: false, samlAvailable: false }
-
-export const CloudEU: StoryFn<StoryArgs> = Template.bind({})
-CloudEU.args = { region: 'EU' }
-
-export const SSOEnforced: StoryFn<StoryArgs> = Template.bind({})
-SSOEnforced.args = { ssoEnforcement: 'google-oauth2' }
-
-export const SAMLAvailable: StoryFn<StoryArgs> = Template.bind({})
-SAMLAvailable.args = { samlAvailable: true }
-
-export const LoginError: StoryFn<StoryArgs> = Template.bind({})
-LoginError.args = { generalError: 'invalid_credentials' }
-
-export const EmailVerification: StoryFn<StoryArgs> = Template.bind({})
-EmailVerification.args = { generalError: 'code_based_verification_sent' }
diff --git a/frontend/src/scenes/authentication/login/Login.stories.tsx b/frontend/src/scenes/authentication/login/Login.stories.tsx
index 234ba815d673..b37a7eb3d110 100644
--- a/frontend/src/scenes/authentication/login/Login.stories.tsx
+++ b/frontend/src/scenes/authentication/login/Login.stories.tsx
@@ -1,165 +1,133 @@
-import { Meta, StoryObj } from '@storybook/react'
-import { router } from 'kea-router'
+import type { Meta, StoryFn } from '@storybook/react'
+import { useEffect } from 'react'
-import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
-import { Login2FA } from 'scenes/authentication/login-2fa/Login2FA'
-import { urls } from 'scenes/urls'
+import { useStorybookMocks } from '~/mocks/browser'
+import preflightJson from '~/mocks/fixtures/_preflight.json'
-import { mswDecorator, useStorybookMocks } from '~/mocks/browser'
-
-import preflightJson from '../../../mocks/fixtures/_preflight.json'
import { Login } from './Login'
import { loginLogic } from './loginLogic'
-const meta: Meta = {
+type StoryArgs = {
+ cloud: boolean
+ region: 'US' | 'EU'
+ googleOAuth: boolean
+ github: boolean
+ gitlab: boolean
+ samlAvailable: boolean
+ ssoEnforcement: 'none' | 'google-oauth2' | 'github' | 'gitlab' | 'saml'
+ generalError: 'none' | 'invalid_credentials' | 'code_based_verification_sent'
+}
+
+const meta: Meta<StoryArgs> = {
title: 'Scenes-Other/Login',
+ tags: ['test-skip'],
parameters: {
layout: 'fullscreen',
viewMode: 'story',
},
- decorators: [
- mswDecorator({
- post: {
- '/api/login/precheck': { sso_enforcement: null, saml_available: false },
- },
- }),
- ],
-}
-export default meta
-
-type Story = StoryObj<{}>
-
-export const Cloud: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- realm: 'cloud',
- can_create_org: true,
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: false },
- },
- },
- })
- return <Login />
+ argTypes: {
+ cloud: { control: 'boolean', name: 'Cloud' },
+ region: { control: 'select', options: ['US', 'EU'], name: 'Region', if: { arg: 'cloud' } },
+ googleOAuth: { control: 'boolean', name: 'Google OAuth' },
+ github: { control: 'boolean', name: 'GitHub' },
+ gitlab: { control: 'boolean', name: 'GitLab' },
+ samlAvailable: { control: 'boolean', name: 'SAML available' },
+ ssoEnforcement: {
+ control: 'select',
+ name: 'SSO enforcement',
+ options: ['none', 'google-oauth2', 'github', 'gitlab', 'saml'],
+ },
+ generalError: {
+ control: 'select',
+ name: 'General error',
+ options: ['none', 'invalid_credentials', 'code_based_verification_sent'],
+ },
},
-}
-
-export const CloudEU: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- region: 'EU',
- realm: 'cloud',
- can_create_org: true,
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: false },
- },
- },
- })
- return <Login />
+ args: {
+ cloud: true,
+ region: 'US',
+ googleOAuth: true,
+ github: true,
+ gitlab: true,
+ samlAvailable: false,
+ ssoEnforcement: 'none',
+ generalError: 'none',
},
}
+export default meta
-export const CloudWithGoogleLoginEnforcement: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- realm: 'cloud',
- can_create_org: true,
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: false },
+const Template: StoryFn<StoryArgs> = ({
+ cloud,
+ region,
+ googleOAuth,
+ github,
+ gitlab,
+ samlAvailable,
+ ssoEnforcement,
+ generalError,
+}) => {
+ const enforcement = ssoEnforcement === 'none' ? null : ssoEnforcement
+
+ useStorybookMocks({
+ get: {
+ '/_preflight': {
+ ...preflightJson,
+ cloud,
+ region: cloud ? region : undefined,
+ realm: cloud ? 'cloud' : 'hosted-clickhouse',
+ is_debug: cloud,
+ can_create_org: cloud,
+ available_social_auth_providers: {
+ 'google-oauth2': googleOAuth,
+ github,
+ gitlab,
+ saml: samlAvailable,
},
},
- post: {
- '/api/login/precheck': { sso_enforcement: 'google-oauth2', saml_available: false },
- },
- })
+ },
+ post: {
+ '/api/login/precheck': { sso_enforcement: enforcement, saml_available: samlAvailable },
+ },
+ })
- // Trigger pre-check
- useDelayedOnMountEffect(() => {
+ useEffect(() => {
+ if (enforcement) {
loginLogic.actions.setLoginValue('email', '[email protected]')
loginLogic.actions.precheck({ email: '[email protected]' })
- })
-
- return <Login />
- },
- parameters: {
- testOptions: {
- waitForSelector: '[href^="/login/google-oauth2/"]',
- },
- },
+ }
+ }, [enforcement])
+
+ useEffect(() => {
+ if (generalError !== 'none') {
+ const messages: Record<string, string> = {
+ invalid_credentials: 'Invalid email or password.',
+ code_based_verification_sent: 'Check your email to verify your account.',
+ }
+ loginLogic.actions.setGeneralError(generalError, messages[generalError] ?? '')
+ } else {
+ loginLogic.actions.clearGeneralError()
+ }
+ }, [generalError])
+
+ return <Login />
}
-export const SelfHosted: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: false,
- realm: 'hosted-clickhouse',
- available_social_auth_providers: {
- github: false,
- gitlab: false,
- 'google-oauth2': false,
- saml: false,
- },
- },
- },
- })
- return <Login />
- },
-}
+export const Default: StoryFn<StoryArgs> = Template.bind({})
-export const SelfHostedWithSAML: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: false,
- realm: 'hosted-clickhouse',
- available_social_auth_providers: {
- github: false,
- gitlab: false,
- 'google-oauth2': false,
- saml: true,
- },
- },
- },
- })
- return <Login />
- },
- parameters: {
- testOptions: {
- waitForSelector: '[href^="/login/saml/"]',
- },
- },
-}
+export const SelfHosted: StoryFn<StoryArgs> = Template.bind({})
+SelfHosted.args = { cloud: false, googleOAuth: false, github: false, gitlab: false, samlAvailable: false }
-export const SSOError: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': preflightJson,
- },
- })
+export const CloudEU: StoryFn<StoryArgs> = Template.bind({})
+CloudEU.args = { region: 'EU' }
- useDelayedOnMountEffect(() => router.actions.push(`${urls.login()}?error_code=improperly_configured_sso`))
+export const SSOEnforced: StoryFn<StoryArgs> = Template.bind({})
+SSOEnforced.args = { ssoEnforcement: 'google-oauth2' }
- return <Login />
- },
-}
+export const SAMLAvailable: StoryFn<StoryArgs> = Template.bind({})
+SAMLAvailable.args = { samlAvailable: true }
-export const SecondFactor: Story = {
- render: () => {
- useDelayedOnMountEffect(() => router.actions.push(urls.login2FA()))
- return <Login2FA />
- },
-}
+export const LoginError: StoryFn<StoryArgs> = Template.bind({})
+LoginError.args = { generalError: 'invalid_credentials' }
+
+export const EmailVerification: StoryFn<StoryArgs> = Template.bind({})
+EmailVerification.args = { generalError: 'code_based_verification_sent' }
diff --git a/frontend/src/scenes/authentication/login/Login.tsx b/frontend/src/scenes/authentication/login/Login.tsx
index e4d1fec98412..4b3bb152069e 100644
--- a/frontend/src/scenes/authentication/login/Login.tsx
+++ b/frontend/src/scenes/authentication/login/Login.tsx
@@ -1,12 +1,10 @@
-import { useActions, useValues } from 'kea'
+import { useActions } from 'kea'
import { useEffect } from 'react'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { passkeyLogic } from 'scenes/authentication/shared/passkeyLogic'
import { SceneExport } from 'scenes/sceneTypes'
-import { authFlowVariantRegistry } from '../authFlowVariantRegistry'
-import { resolveAuthFlowVariant } from '../authFlowVariants'
+import { LoginForm } from './LoginForm'
import { loginLogic } from './loginLogic'
export const scene: SceneExport = {
@@ -15,9 +13,7 @@ export const scene: SceneExport = {
}
export function Login(): JSX.Element {
- const { featureFlags } = useValues(featureFlagLogic)
const { startConditionalPasskeyLogin } = useActions(passkeyLogic)
- const { Login: VariantLogin } = authFlowVariantRegistry[resolveAuthFlowVariant(featureFlags)]
// WebKit (Safari/iOS) can't open the passkey modal without a user gesture, so we show
// passkeys via the email field's autofill instead. Other browsers keep the auto-modal.
@@ -25,5 +21,5 @@ export function Login(): JSX.Element {
startConditionalPasskeyLogin()
}, [startConditionalPasskeyLogin])
- return <VariantLogin />
+ return <LoginForm />
}
diff --git a/frontend/src/scenes/authentication/login/variants/paper-desk/PaperDeskLogin.tsx b/frontend/src/scenes/authentication/login/LoginForm.tsx
similarity index 95%
rename from frontend/src/scenes/authentication/login/variants/paper-desk/PaperDeskLogin.tsx
rename to frontend/src/scenes/authentication/login/LoginForm.tsx
index f4f23d044294..d8dc368b653b 100644
--- a/frontend/src/scenes/authentication/login/variants/paper-desk/PaperDeskLogin.tsx
+++ b/frontend/src/scenes/authentication/login/LoginForm.tsx
@@ -16,23 +16,23 @@ import { LemonInput } from 'lib/lemon-ui/LemonInput/LemonInput'
import { Link } from 'lib/lemon-ui/Link'
import { isWebKitBrowser } from 'lib/utils/dom'
import { isEmail } from 'lib/utils/url'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
+import { RegionField } from 'scenes/authentication/shared/authScene/RegionField'
import { ERROR_MESSAGES } from 'scenes/authentication/shared/loginErrorMessages'
import { OtherRegionHint } from 'scenes/authentication/shared/OtherRegionHint'
-import { CardTitle } from 'scenes/authentication/shared/paperDesk/CardTitle'
-import { PaperDeskCard, PaperDeskScene, usePaperDeskTheme } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'
-import { RegionField } from 'scenes/authentication/shared/paperDesk/RegionField'
import { RedirectIfLoggedInOtherInstance } from 'scenes/authentication/shared/RedirectToLoggedInInstance'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { urls } from 'scenes/urls'
import { LoginMethod } from '~/types'
-import { loginLogic } from '../../loginLogic'
-import { SessionRiskBanner } from '../../SessionRiskBanner'
+import { loginLogic } from './loginLogic'
+import { SessionRiskBanner } from './SessionRiskBanner'
const LAST_LOGIN_METHOD_COOKIE = 'ph_last_login_method'
-function Login(): JSX.Element {
+export function LoginForm(): JSX.Element {
const { precheck, exitCodeVerification, resendCodeBasedVerification } = useActions(loginLogic)
const { openSupportForm } = useActions(supportLogic)
const {
@@ -52,7 +52,6 @@ function Login(): JSX.Element {
autoRedirectingToProvider,
} = useValues(loginLogic)
const { preflight } = useValues(preflightLogic)
- const theme = usePaperDeskTheme()
const isPasswordHidden = !!precheckResponse.sso_enforcement || isPasswordLoginUnavailable
const isCodeSent = codeVerificationRequired
@@ -82,22 +81,20 @@ function Login(): JSX.Element {
)
return (
- <PaperDeskScene notes={['// welcome back', '// 500,000+ teams ship here']}>
+ <AuthScene notes={['// welcome back', '// 500,000+ teams ship here']}>
{preflight?.cloud && <RedirectIfLoggedInOtherInstance />}
- <PaperDeskCard footer={footer}>
- <CardTitle
+ <AuthSceneCard footer={footer}>
+ <AuthCardTitle
title={
isCodeSent ? (
'Enter your login code'
- ) : theme === 'glass' ? (
+ ) : (
<>
Log in to{' '}
<span className="px-1 rounded-md bg-[color-mix(in_srgb,var(--color-blue-500)_10%,transparent)] text-[var(--color-blue-500)]">
@PostHog
</span>
</>
- ) : (
- 'Log in to PostHog'
)
}
sub={isCodeSent ? undefined : "Welcome back. Let's go ship something."}
@@ -314,9 +311,7 @@ function Login(): JSX.Element {
showPasskey={!isPasswordLoginUnavailable || !!precheckResponse.webauthn_credentials?.length}
/>
)}
- </PaperDeskCard>
- </PaperDeskScene>
+ </AuthSceneCard>
+ </AuthScene>
)
}
-
-export { Login as PaperDeskLogin }
diff --git a/frontend/src/scenes/authentication/login/PaperDeskLogin.stories.tsx b/frontend/src/scenes/authentication/login/PaperDeskLogin.stories.tsx
deleted file mode 100644
index 6ca40d24854c..000000000000
--- a/frontend/src/scenes/authentication/login/PaperDeskLogin.stories.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import type { Meta, StoryFn } from '@storybook/react'
-import { useEffect } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-
-import { useStorybookMocks } from '~/mocks/browser'
-import preflightJson from '~/mocks/fixtures/_preflight.json'
-
-import { Login } from './Login'
-import { loginLogic } from './loginLogic'
-
-type StoryArgs = {
- cloud: boolean
- region: 'US' | 'EU'
- googleOAuth: boolean
- github: boolean
- gitlab: boolean
- samlAvailable: boolean
- ssoEnforcement: 'none' | 'google-oauth2' | 'github' | 'gitlab' | 'saml'
- generalError: 'none' | 'invalid_credentials' | 'code_based_verification_sent'
-}
-
-const meta: Meta<StoryArgs> = {
- title: 'Scenes-Other/Login (paper-desk)',
- tags: ['test-skip'],
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'paper-desk' },
- },
- argTypes: {
- cloud: { control: 'boolean', name: 'Cloud' },
- region: { control: 'select', options: ['US', 'EU'], name: 'Region', if: { arg: 'cloud' } },
- googleOAuth: { control: 'boolean', name: 'Google OAuth' },
- github: { control: 'boolean', name: 'GitHub' },
- gitlab: { control: 'boolean', name: 'GitLab' },
- samlAvailable: { control: 'boolean', name: 'SAML available' },
- ssoEnforcement: {
- control: 'select',
- name: 'SSO enforcement',
- options: ['none', 'google-oauth2', 'github', 'gitlab', 'saml'],
- },
- generalError: {
- control: 'select',
- name: 'General error',
- options: ['none', 'invalid_credentials', 'code_based_verification_sent'],
- },
- },
- args: {
- cloud: true,
- region: 'US',
- googleOAuth: true,
- github: true,
- gitlab: true,
- samlAvailable: false,
- ssoEnforcement: 'none',
- generalError: 'none',
- },
-}
-export default meta
-
-const Template: StoryFn<StoryArgs> = ({
- cloud,
- region,
- googleOAuth,
- github,
- gitlab,
- samlAvailable,
- ssoEnforcement,
- generalError,
-}) => {
- const enforcement = ssoEnforcement === 'none' ? null : ssoEnforcement
-
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud,
- region: cloud ? region : undefined,
- realm: cloud ? 'cloud' : 'hosted-clickhouse',
- is_debug: cloud,
- can_create_org: cloud,
- available_social_auth_providers: {
- 'google-oauth2': googleOAuth,
- github,
- gitlab,
- saml: samlAvailable,
- },
- },
- },
- post: {
- '/api/login/precheck': { sso_enforcement: enforcement, saml_available: samlAvailable },
- },
- })
-
- useEffect(() => {
- if (enforcement) {
- loginLogic.actions.setLoginValue('email', '[email protected]')
- loginLogic.actions.precheck({ email: '[email protected]' })
- }
- }, [enforcement])
-
- useEffect(() => {
- if (generalError !== 'none') {
- const messages: Record<string, string> = {
- invalid_credentials: 'Invalid email or password.',
- code_based_verification_sent: 'Check your email to verify your account.',
- }
- loginLogic.actions.setGeneralError(generalError, messages[generalError] ?? '')
- } else {
- loginLogic.actions.clearGeneralError()
- }
- }, [generalError])
-
- return <Login />
-}
-
-export const Default: StoryFn<StoryArgs> = Template.bind({})
-
-export const SelfHosted: StoryFn<StoryArgs> = Template.bind({})
-SelfHosted.args = { cloud: false, googleOAuth: false, github: false, gitlab: false, samlAvailable: false }
-
-export const CloudEU: StoryFn<StoryArgs> = Template.bind({})
-CloudEU.args = { region: 'EU' }
-
-export const SSOEnforced: StoryFn<StoryArgs> = Template.bind({})
-SSOEnforced.args = { ssoEnforcement: 'google-oauth2' }
-
-export const SAMLAvailable: StoryFn<StoryArgs> = Template.bind({})
-SAMLAvailable.args = { samlAvailable: true }
-
-export const LoginError: StoryFn<StoryArgs> = Template.bind({})
-LoginError.args = { generalError: 'invalid_credentials' }
-
-export const EmailVerification: StoryFn<StoryArgs> = Template.bind({})
-EmailVerification.args = { generalError: 'code_based_verification_sent' }
diff --git a/frontend/src/scenes/authentication/login/variants/glass/GlassLogin.tsx b/frontend/src/scenes/authentication/login/variants/glass/GlassLogin.tsx
deleted file mode 100644
index 5014c2559f34..000000000000
--- a/frontend/src/scenes/authentication/login/variants/glass/GlassLogin.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { PaperDeskThemeProvider } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'
-
-import { PaperDeskLogin } from '../paper-desk/PaperDeskLogin'
-
-/** The paper-desk page re-skinned with posthog.com's garden design language - behavior unchanged. */
-export function GlassLogin(): JSX.Element {
- return (
- <PaperDeskThemeProvider theme="glass">
- <PaperDeskLogin />
- </PaperDeskThemeProvider>
- )
-}
diff --git a/frontend/src/scenes/authentication/login/variants/legacy/LegacyLogin.tsx b/frontend/src/scenes/authentication/login/variants/legacy/LegacyLogin.tsx
deleted file mode 100644
index b46c4490fd1c..000000000000
--- a/frontend/src/scenes/authentication/login/variants/legacy/LegacyLogin.tsx
+++ /dev/null
@@ -1,377 +0,0 @@
-import '../../Login.scss'
-
-import clsx from 'clsx'
-import { useActions, useValues } from 'kea'
-import { Form } from 'kea-forms'
-import { useEffect, useRef } from 'react'
-
-import { LemonButton, LemonInput, LemonTag } from '@posthog/lemon-ui'
-
-import { getCookie } from 'lib/api'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import { SSOEnforcedLoginButton, SocialLoginButtons } from 'lib/components/SocialLoginButton/SocialLoginButton'
-import { supportLogic } from 'lib/components/Support/supportLogic'
-import { SSO_PROVIDER_NAMES } from 'lib/constants'
-import { usePrevious } from 'lib/hooks/usePrevious'
-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
-import { LemonField } from 'lib/lemon-ui/LemonField'
-import { Link } from 'lib/lemon-ui/Link'
-import { Skeleton } from 'lib/ui/quill'
-import { isWebKitBrowser } from 'lib/utils/dom'
-import { isEmail } from 'lib/utils/url'
-import { ERROR_MESSAGES } from 'scenes/authentication/shared/loginErrorMessages'
-import { OtherRegionHint } from 'scenes/authentication/shared/OtherRegionHint'
-import { RedirectIfLoggedInOtherInstance } from 'scenes/authentication/shared/RedirectToLoggedInInstance'
-import RegionSelect from 'scenes/authentication/shared/RegionSelect'
-import { SupportModalButton } from 'scenes/authentication/shared/SupportModalButton'
-import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
-import { urls } from 'scenes/urls'
-
-import { LoginMethod } from '~/types'
-
-import { loginLogic } from '../../loginLogic'
-import { SessionRiskBanner } from '../../SessionRiskBanner'
-
-const LAST_LOGIN_METHOD_COOKIE = 'ph_last_login_method'
-
-function Login(): JSX.Element {
- const { precheck, resendCodeBasedVerification, exitCodeVerification, resetLogin, devLogin, loadDevUsers } =
- useActions(loginLogic)
- const { openSupportForm } = useActions(supportLogic)
- const {
- precheckResponse,
- precheckResponseLoading,
- login,
- isLoginSubmitting,
- generalError,
- signupUrl,
- resendResponseLoading,
- codeVerificationRequired,
- isCodeVerificationSubmitting,
- devUsers,
- devUsersLoading,
- devLoginTimeSavedLabel,
- isPasswordLoginUnavailable,
- hasNoConfiguredLoginMethod,
- restrictToProviders,
- autoRedirectingToProvider,
- } = useValues(loginLogic)
- const { preflight } = useValues(preflightLogic)
- const allowDevLogin = !!preflight?.allow_dev_login
-
- useEffect(() => {
- if (allowDevLogin) {
- loadDevUsers(null)
- }
- }, [allowDevLogin, loadDevUsers])
-
- const passwordInputRef = useRef<HTMLInputElement>(null)
- const preventPasswordError = useRef(false)
- const isPasswordHidden =
- precheckResponse.status === 'pending' || !!precheckResponse.sso_enforcement || isPasswordLoginUnavailable
- const isCodeSent = codeVerificationRequired
- const loginTitle = isCodeSent ? 'Enter your login code' : 'Log in'
- const wasPasswordHiddenRef = useRef(isPasswordHidden)
-
- const lastLoginMethod = getCookie(LAST_LOGIN_METHOD_COOKIE) as LoginMethod
- const prevEmail = usePrevious(login.email)
-
- useEffect(() => {
- const wasPasswordHidden = wasPasswordHiddenRef.current
- wasPasswordHiddenRef.current = isPasswordHidden
-
- if (!isPasswordHidden) {
- passwordInputRef.current?.focus()
- } else if (!wasPasswordHidden) {
- // Drop any typed password when the field goes away, but keep the email — the SSO and
- // social buttons we show instead need it.
- resetLogin({ email: login.email, password: '' })
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [isPasswordHidden, resetLogin])
-
- // Trigger precheck for password manager autofill/paste (detected by large character delta)
- useEffect(() => {
- const charDelta = login.email.length - (prevEmail?.length ?? 0)
- const isAutofill = charDelta > 1
-
- if (isAutofill && isEmail(login.email, { requireTLD: true }) && precheckResponse.status === 'pending') {
- precheck({ email: login.email })
- }
- }, [login.email, prevEmail, precheckResponse.status, precheck])
-
- return (
- <BridgePage view="login" footer={<SupportModalButton />}>
- {preflight?.cloud && <RedirectIfLoggedInOtherInstance />}
- <div className="deprecated-space-y-4">
- <h2>{loginTitle}</h2>
- <SessionRiskBanner />
- {generalError && (
- <LemonBanner type={generalError.code === 'code_based_verification_sent' ? 'warning' : 'error'}>
- <>
- {generalError.detail || ERROR_MESSAGES[generalError.code] || (
- <>
- Could not complete your login.
- <br />
- Please try again.
- </>
- )}
- {preflight?.cloud && (
- <>
- {' '}
- <Link
- data-attr="login-error-contact-support"
- onClick={(e) => {
- e.preventDefault()
- openSupportForm({
- kind: 'support',
- email: login.email,
- })
- }}
- >
- Need help?
- </Link>
- </>
- )}
- </>
- </LemonBanner>
- )}
- {generalError?.code === 'invalid_credentials' && <OtherRegionHint />}
- {isCodeSent ? (
- <Form
- logic={loginLogic}
- formKey="codeVerification"
- enableFormOnSubmit
- className="deprecated-space-y-4"
- >
- <LemonField name="code" label="Verification code">
- <LemonInput
- className="ph-ignore-input"
- autoFocus
- data-attr="code-verification"
- placeholder="123456"
- inputMode="numeric"
- autoComplete="one-time-code"
- />
- </LemonField>
- <LemonButton
- type="primary"
- status="alt"
- htmlType="submit"
- data-attr="code-verification-submit"
- fullWidth
- center
- size="large"
- loading={isCodeVerificationSubmitting}
- >
- Verify and log in
- </LemonButton>
- <div className="flex justify-center">
- <LemonButton
- type="tertiary"
- size="small"
- loading={resendResponseLoading}
- onClick={() => resendCodeBasedVerification(null)}
- >
- Resend code
- </LemonButton>
- </div>
- <div className="text-center">
- <Link onClick={() => exitCodeVerification()} className="text-muted">
- Back to login
- </Link>
- </div>
- </Form>
- ) : (
- <Form
- logic={loginLogic}
- formKey="login"
- enableFormOnSubmit
- onSubmitCapture={(e) => {
- if (isPasswordHidden || preventPasswordError.current) {
- e.preventDefault()
- e.stopPropagation()
- preventPasswordError.current = false
- }
- }}
- className="deprecated-space-y-4"
- >
- <RegionSelect />
- <LemonField name="email" label="Email">
- <LemonInput
- className="ph-ignore-input"
- autoFocus
- data-attr="login-email"
- placeholder="[email protected]"
- type="email"
- // The `webauthn` token enables passkey autofill (conditional UI), which
- // we only offer on WebKit; elsewhere the auto-modal handles passkeys.
- autoComplete={isWebKitBrowser() ? 'username webauthn' : undefined}
- // `autoAttempt` is only ever set here and on Enter — an explicit
- // gesture — so autofill or a mistyped address can't bounce the user
- // out to an identity provider.
- onBlur={() => precheck({ email: login.email, autoAttempt: true })}
- onPressEnter={(e) => {
- if (isPasswordHidden) {
- e.preventDefault() // Don't trigger submission if password field is still hidden
- precheck({ email: login.email, autoAttempt: true })
- passwordInputRef.current?.focus()
- }
- }}
- badgeText={lastLoginMethod === 'password' ? 'Last used' : undefined}
- />
- </LemonField>
- <div className={clsx('PasswordWrapper', isPasswordHidden && 'zero-height')}>
- <LemonField
- name="password"
- label={
- <div className="flex flex-1 items-center justify-between gap-2">
- <span>Password</span>
- <Link
- to={[urls.passwordReset(), { email: login.email }]}
- data-attr="forgot-password"
- tabIndex={-1}
- >
- Forgot your password?
- </Link>
- </div>
- }
- >
- <LemonInput
- type="password"
- inputRef={passwordInputRef}
- className="ph-ignore-input"
- data-attr="password"
- placeholder="••••••••••"
- autoComplete="current-password"
- />
- </LemonField>
- </div>
-
- {hasNoConfiguredLoginMethod && (
- <LemonBanner type="warning">
- No sign-in method is set up for this account. Use{' '}
- <Link to={[urls.passwordReset(), { email: login.email }]} data-attr="forgot-password">
- Forgot your password?
- </Link>{' '}
- to set a password by email.
- </LemonBanner>
- )}
-
- {autoRedirectingToProvider && (
- <p className="text-secondary text-center mb-0">
- Redirecting to {SSO_PROVIDER_NAMES[autoRedirectingToProvider]}…
- </p>
- )}
-
- {/* Show regular login button unless SSO is enforced or we know the account has
- no password to submit — otherwise it's a button that does nothing. It stays
- while precheck is pending, where it doubles as a "continue" affordance. */}
- {!precheckResponse.sso_enforcement && !isPasswordLoginUnavailable && (
- <LemonButton
- type="primary"
- status="alt"
- htmlType="submit"
- data-attr="password-login"
- fullWidth
- center
- loading={isLoginSubmitting || precheckResponseLoading}
- size="large"
- onMouseDown={() => {
- if (isPasswordHidden) {
- // prevent empty password error
- preventPasswordError.current = true
- }
- }}
- >
- Log in
- </LemonButton>
- )}
-
- {/* Show enforced SSO button if required */}
- {precheckResponse.sso_enforcement && (
- <SSOEnforcedLoginButton
- provider={precheckResponse.sso_enforcement}
- email={login.email}
- isLastUsed={lastLoginMethod === precheckResponse.sso_enforcement}
- />
- )}
-
- {/* Show optional SAML SSO button if available */}
- {precheckResponse.saml_available && !precheckResponse.sso_enforcement && (
- <SSOEnforcedLoginButton
- provider="saml"
- email={login.email}
- isLastUsed={lastLoginMethod === 'saml'}
- />
- )}
- </Form>
- )}
- {!isCodeSent && preflight?.cloud && (
- <div className="text-center mt-4">
- Don't have an account?{' '}
- <Link to={[signupUrl, { email: login.email }]} data-attr="signup" className="font-bold">
- Create an account
- </Link>
- </div>
- )}
- {/* Normally SAML replaces this row, but when the account has no password we need to
- show whatever it does have. */}
- {!isCodeSent &&
- !precheckResponse.sso_enforcement &&
- (!precheckResponse.saml_available || isPasswordLoginUnavailable) && (
- <SocialLoginButtons
- caption={isPasswordLoginUnavailable ? 'Log in with' : 'Or log in with'}
- topDivider
- lastUsedProvider={lastLoginMethod}
- restrictToProviders={restrictToProviders}
- // Once we know the account's methods, only offer a passkey if it actually has
- // one — otherwise this is the same dead button we're removing.
- showPasskey={!isPasswordLoginUnavailable || !!precheckResponse.webauthn_credentials?.length}
- />
- )}
- {allowDevLogin && (
- <div className="deprecated-space-y-2 border-t border-dashed pt-4 mt-4">
- <div className="flex items-center justify-between">
- <h4 className="m-0">Dev login</h4>
- </div>
- <p className="text-muted text-sm m-0">
- Click a user to log in without a password. This list is only exposed in development mode.
- </p>
- {!devUsersLoading && devLoginTimeSavedLabel && (
- <p className="text-muted text-sm m-0">{devLoginTimeSavedLabel}</p>
- )}
- {devUsersLoading && <Skeleton className="w-full h-10" />}
- <div className="deprecated-space-y-1">
- {devUsers.map((u) => (
- <LemonButton
- key={u.email}
- type="secondary"
- fullWidth
- data-attr={`dev-login-${u.email}`}
- onClick={() => devLogin(u.email)}
- >
- <span className="flex items-center gap-2 w-full">
- <span className="flex-1 text-left truncate">{u.email}</span>
- {u.label && (
- <LemonTag type="success" size="small">
- {u.label}
- </LemonTag>
- )}
- {u.is_staff && !u.label && (
- <LemonTag type="default" size="small">
- Staff
- </LemonTag>
- )}
- </span>
- </LemonButton>
- ))}
- </div>
- </div>
- )}
- </div>
- </BridgePage>
- )
-}
-
-export { Login as LegacyLogin }
diff --git a/frontend/src/scenes/authentication/shared/paperDesk/CardTitle.tsx b/frontend/src/scenes/authentication/shared/authScene/AuthCardTitle.tsx
similarity index 93%
rename from frontend/src/scenes/authentication/shared/paperDesk/CardTitle.tsx
rename to frontend/src/scenes/authentication/shared/authScene/AuthCardTitle.tsx
index df33c63c8b00..aa449824d8ea 100644
--- a/frontend/src/scenes/authentication/shared/paperDesk/CardTitle.tsx
+++ b/frontend/src/scenes/authentication/shared/authScene/AuthCardTitle.tsx
@@ -1,6 +1,6 @@
import { type ReactNode } from 'react'
-export function CardTitle({
+export function AuthCardTitle({
title,
sub,
className,
diff --git a/frontend/src/scenes/authentication/shared/paperDesk/PaperDesk.scss b/frontend/src/scenes/authentication/shared/authScene/AuthScene.scss
similarity index 58%
rename from frontend/src/scenes/authentication/shared/paperDesk/PaperDesk.scss
rename to frontend/src/scenes/authentication/shared/authScene/AuthScene.scss
index d03aa8d7ec22..310a98613d93 100644
--- a/frontend/src/scenes/authentication/shared/paperDesk/PaperDesk.scss
+++ b/frontend/src/scenes/authentication/shared/authScene/AuthScene.scss
@@ -1,34 +1,12 @@
-// Paper-desk auth variant — light mode only (unauthenticated auth scenes are forced light).
+// Unauthenticated auth scenes are forced light.
// Only rules that cannot be expressed in Tailwind utilities live here:
// pseudo-elements, interactive pseudo-class combinators, child selectors, keyframes.
-// Dotted paper grid + faint accent glow — multi-layer background (per-layer size/repeat), not achievable via Tailwind
-.PaperDesk {
+.AuthScene {
--primary-3000-button-bg: var(--warning);
--primary-3000-frame-bg: var(--primary-3000-button-border-light);
--primary-3000-button-border: var(--primary-3000-button-border-light);
--primary-3000-button-border-hover: var(--primary-3000-button-border-hover-light);
-
- // Links use the bright brand amber, not the darker text-contrast warning token.
- --color-text-warning: var(--warning);
-
- // Accent glow over the dotted grid. Layered onto the element itself rather than absolutely
- // positioned pseudo-elements so the texture stays fixed to the viewport while the scene scrolls
- // (a card taller than the viewport scrolls inside .PaperDesk; pseudo-elements would scroll away).
- // background-color stays on the Tailwind `bg-[#eef0e7]` utility — only the image layers live here.
- background-image:
- radial-gradient(72% 72% at 50% 38%, rgb(247 165 1 / 5%), transparent 70%),
- radial-gradient(rgb(17 17 17 / 5.5%) 1.4px, transparent 1.4px);
- background-repeat: no-repeat, repeat;
- background-size:
- auto,
- 16px 16px;
-}
-
-// Glass variant uses posthog.com's layered garden greens with a soft light well behind the card.
-// The base color overrides the parchment `bg-[#eef0e7]` utility because unlayered rules beat
-// Tailwind's cascade layer.
-.PaperDesk--glass {
--color-text-warning: var(--color-text-primary);
background-color: #b5cd8f;
@@ -39,7 +17,7 @@
background-size: auto;
// The cream OS-window card the new website (and the self-driving onboarding) uses.
- .PaperDesk__card {
+ .AuthScene__card {
background: #f6f5f0;
border-color: #e3e0d4;
border-radius: 1rem;
@@ -47,13 +25,13 @@
}
// Corner notes read as dark-green ink on the garden rather than gray on parchment.
- .PaperDesk__notes div {
+ .AuthScene__notes div {
color: rgb(45 74 22 / 65%);
}
}
// Paper sheet resting on the desk — the login card and the dev login panel share it.
-.PaperDesk__card {
+.AuthScene__card {
background: #fff;
border: 1px solid #e0e1d9;
border-radius: var(--radius-lg);
@@ -63,7 +41,7 @@
}
// Child SVG sizing — child selector, no Tailwind equivalent
-.PaperDesk__logo {
+.AuthScene__logo {
svg {
display: block;
width: auto;
@@ -76,7 +54,7 @@
}
// Invite header mark SVG sizing
-.PaperDesk__inviteHeader-mark {
+.AuthScene__inviteHeader-mark {
svg {
width: auto;
height: 30px;
@@ -84,9 +62,9 @@
}
// Sub paragraph — code and mono spans inside it share styles
-.PaperDesk__sub {
+.AuthScene__sub {
code,
- .PaperDesk__mono {
+ .AuthScene__mono {
font-family: var(--font-mono);
font-size: 13px;
color: #111;
@@ -94,7 +72,7 @@
}
// Terms text — nested link style
-.PaperDesk__terms {
+.AuthScene__terms {
a {
font-weight: 600;
color: rgb(17 17 17 / 58%);
@@ -104,34 +82,34 @@
}
// Note callout — bold inside it is darker
-.PaperDesk__note {
+.AuthScene__note {
b {
color: #111;
}
}
// Blink animation for typewriter caret
-.PaperDesk__caret {
- animation: PaperDesk__blink 1.05s steps(1) infinite;
+.AuthScene__caret {
+ animation: AuthScene__blink 1.05s steps(1) infinite;
}
@media (prefers-reduced-motion: no-preference) {
- .PaperDesk__column {
- animation: PaperDesk__rise 0.28s cubic-bezier(0.16, 1, 0.3, 1);
+ .AuthScene__column {
+ animation: AuthScene__rise 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
- .PaperDesk__progress-fill {
- animation: PaperDesk__progress 2.2s cubic-bezier(0.16, 1, 0.3, 1);
+ .AuthScene__progress-fill {
+ animation: AuthScene__progress 2.2s cubic-bezier(0.16, 1, 0.3, 1);
}
}
@media (prefers-reduced-motion: reduce) {
- .PaperDesk__caret {
+ .AuthScene__caret {
animation: none;
}
}
-@keyframes PaperDesk__blink {
+@keyframes AuthScene__blink {
0%,
50% {
opacity: 1;
@@ -143,7 +121,7 @@
}
}
-@keyframes PaperDesk__rise {
+@keyframes AuthScene__rise {
from {
opacity: 0;
transform: translateY(8px);
@@ -155,7 +133,7 @@
}
}
-@keyframes PaperDesk__progress {
+@keyframes AuthScene__progress {
from {
width: 0%;
}
diff --git a/frontend/src/scenes/authentication/shared/authScene/AuthScene.tsx b/frontend/src/scenes/authentication/shared/authScene/AuthScene.tsx
new file mode 100644
index 000000000000..a3624a195bff
--- /dev/null
+++ b/frontend/src/scenes/authentication/shared/authScene/AuthScene.tsx
@@ -0,0 +1,48 @@
+import './AuthScene.scss'
+
+import { type ReactNode } from 'react'
+
+import { Logo } from 'lib/brand'
+import { cn } from 'lib/utils/css-classes'
+
+import { DevLoginPanel } from './DevLoginPanel'
+import { Typewriter } from './Typewriter'
+
+export function AuthScene({ notes, children }: { notes: string[]; children: ReactNode }): JSX.Element {
+ return (
+ <div className={cn('AuthScene relative h-screen overflow-x-hidden overflow-y-auto font-sans text-primary')}>
+ <div className="hidden sm:block">
+ <Typewriter lines={notes} />
+ </div>
+ <div className="relative z-[3] flex flex-col items-center justify-center min-h-full py-18 px-4 sm:px-10">
+ <div className="AuthScene__column flex flex-col items-center w-[27rem] max-w-full">{children}</div>
+ </div>
+ <DevLoginPanel />
+ </div>
+ )
+}
+
+/** Logo (or custom header) + white card + optional footer note — the column contents. */
+export function AuthSceneCard({
+ top,
+ footer,
+ children,
+}: {
+ top?: ReactNode
+ footer?: ReactNode
+ children: ReactNode
+}): JSX.Element {
+ return (
+ <>
+ {top === undefined ? (
+ <span className="AuthScene__logo block mb-4">
+ <Logo variant="gradient" size="lg" />
+ </span>
+ ) : (
+ top
+ )}
+ <div className="AuthScene__card w-full pt-8 px-5 sm:px-9 pb-8">{children}</div>
+ {footer}
+ </>
+ )
+}
diff --git a/frontend/src/scenes/authentication/shared/paperDesk/DevLoginPanel.stories.tsx b/frontend/src/scenes/authentication/shared/authScene/DevLoginPanel.stories.tsx
similarity index 100%
rename from frontend/src/scenes/authentication/shared/paperDesk/DevLoginPanel.stories.tsx
rename to frontend/src/scenes/authentication/shared/authScene/DevLoginPanel.stories.tsx
diff --git a/frontend/src/scenes/authentication/shared/paperDesk/DevLoginPanel.tsx b/frontend/src/scenes/authentication/shared/authScene/DevLoginPanel.tsx
similarity index 99%
rename from frontend/src/scenes/authentication/shared/paperDesk/DevLoginPanel.tsx
rename to frontend/src/scenes/authentication/shared/authScene/DevLoginPanel.tsx
index 6caad8ffb79b..8c95389282d3 100644
--- a/frontend/src/scenes/authentication/shared/paperDesk/DevLoginPanel.tsx
+++ b/frontend/src/scenes/authentication/shared/authScene/DevLoginPanel.tsx
@@ -48,7 +48,7 @@ export function DevLoginPanel(): JSX.Element | null {
}
return (
- <div className="PaperDesk__card fixed top-4 right-4 z-50 flex flex-col w-72 max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]">
+ <div className="AuthScene__card fixed top-4 right-4 z-50 flex flex-col w-72 max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]">
<div className="flex items-center justify-between gap-2 pl-3 pr-1.5 py-1.5 border-b border-[#e0e1d9]">
<span className="text-xs font-semibold text-muted">Login tools</span>
<LemonButton
diff --git a/frontend/src/scenes/authentication/shared/paperDesk/OrgTile.tsx b/frontend/src/scenes/authentication/shared/authScene/OrgTile.tsx
similarity index 100%
rename from frontend/src/scenes/authentication/shared/paperDesk/OrgTile.tsx
rename to frontend/src/scenes/authentication/shared/authScene/OrgTile.tsx
diff --git a/frontend/src/scenes/authentication/shared/paperDesk/RegionField.tsx b/frontend/src/scenes/authentication/shared/authScene/RegionField.tsx
similarity index 100%
rename from frontend/src/scenes/authentication/shared/paperDesk/RegionField.tsx
rename to frontend/src/scenes/authentication/shared/authScene/RegionField.tsx
diff --git a/frontend/src/scenes/authentication/shared/paperDesk/Typewriter.tsx b/frontend/src/scenes/authentication/shared/authScene/Typewriter.tsx
similarity index 94%
rename from frontend/src/scenes/authentication/shared/paperDesk/Typewriter.tsx
rename to frontend/src/scenes/authentication/shared/authScene/Typewriter.tsx
index e4a21f33d382..69a3fcbac48f 100644
--- a/frontend/src/scenes/authentication/shared/paperDesk/Typewriter.tsx
+++ b/frontend/src/scenes/authentication/shared/authScene/Typewriter.tsx
@@ -37,7 +37,7 @@ export function Typewriter({ lines }: { lines: string[] }): JSX.Element {
const parts = full.slice(0, shown).split('\n')
return (
<div
- className="PaperDesk__notes absolute top-[clamp(20px,4vh,40px)] left-[clamp(20px,4vw,44px)] z-[2] min-h-[2.6em] font-mono text-xs leading-relaxed whitespace-pre"
+ className="AuthScene__notes absolute top-[clamp(20px,4vh,40px)] left-[clamp(20px,4vw,44px)] z-[2] min-h-[2.6em] font-mono text-xs leading-relaxed whitespace-pre"
aria-hidden
// Chrome's in-page translation replaces text nodes with <font> elements; on this
// 40ms-tick animation React then crashes removing text it no longer owns
@@ -48,7 +48,7 @@ export function Typewriter({ lines }: { lines: string[] }): JSX.Element {
<div key={idx} className="text-primary/50 first:font-semibold">
{part}
{idx === parts.length - 1 && (
- <span className="PaperDesk__caret inline-block w-2 h-[1.05em] ml-0.5 [vertical-align:-2px] bg-warning rounded-[1px]" />
+ <span className="AuthScene__caret inline-block w-2 h-[1.05em] ml-0.5 [vertical-align:-2px] bg-warning rounded-[1px]" />
)}
</div>
))}
diff --git a/frontend/src/scenes/authentication/shared/paperDesk/PaperDeskScene.tsx b/frontend/src/scenes/authentication/shared/paperDesk/PaperDeskScene.tsx
deleted file mode 100644
index 16c9f8dd605e..000000000000
--- a/frontend/src/scenes/authentication/shared/paperDesk/PaperDeskScene.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-import './PaperDesk.scss'
-
-import { type ReactNode, createContext, useContext } from 'react'
-
-import { Logo } from 'lib/brand'
-import { cn } from 'lib/utils/css-classes'
-
-import { DevLoginPanel } from './DevLoginPanel'
-import { Typewriter } from './Typewriter'
-
-/** Which skin the stage wears: the parchment desk, or the posthog.com garden ("glass" variant). */
-export type PaperDeskTheme = 'paper' | 'glass'
-
-const PaperDeskThemeContext = createContext<PaperDeskTheme>('paper')
-
-export function usePaperDeskTheme(): PaperDeskTheme {
- return useContext(PaperDeskThemeContext)
-}
-
-/** Wrap a paper-desk page to re-skin it - the glass variant renders the same pages through this. */
-export function PaperDeskThemeProvider({
- theme,
- children,
-}: {
- theme: PaperDeskTheme
- children: ReactNode
-}): JSX.Element {
- return <PaperDeskThemeContext.Provider value={theme}>{children}</PaperDeskThemeContext.Provider>
-}
-
-/** Full-viewport paper-desk stage: dotted parchment + accent glow + mono corner notes. */
-export function PaperDeskScene({ notes, children }: { notes: string[]; children: ReactNode }): JSX.Element {
- const theme = usePaperDeskTheme()
- return (
- <div
- className={cn(
- 'PaperDesk relative h-screen overflow-x-hidden overflow-y-auto font-sans text-primary bg-[#eef0e7]',
- theme === 'glass' && 'PaperDesk--glass'
- )}
- >
- <div className="hidden sm:block">
- <Typewriter lines={notes} />
- </div>
- <div className="relative z-[3] flex flex-col items-center justify-center min-h-full py-18 px-4 sm:px-10">
- <div className="PaperDesk__column flex flex-col items-center w-[27rem] max-w-full">{children}</div>
- </div>
- <DevLoginPanel />
- </div>
- )
-}
-
-/** Logo (or custom header) + white card + optional footer note — the column contents. */
-export function PaperDeskCard({
- top,
- footer,
- children,
-}: {
- top?: ReactNode
- footer?: ReactNode
- children: ReactNode
-}): JSX.Element {
- return (
- <>
- {top === undefined ? (
- <span className="PaperDesk__logo block mb-4">
- <Logo variant="gradient" size="lg" />
- </span>
- ) : (
- top
- )}
- <div className="PaperDesk__card w-full pt-8 px-5 sm:px-9 pb-8">{children}</div>
- {footer}
- </>
- )
-}
diff --git a/frontend/src/scenes/authentication/signup/GlassSignup.stories.tsx b/frontend/src/scenes/authentication/signup/GlassSignup.stories.tsx
deleted file mode 100644
index bc2c9353c855..000000000000
--- a/frontend/src/scenes/authentication/signup/GlassSignup.stories.tsx
+++ /dev/null
@@ -1,118 +0,0 @@
-import type { Meta, StoryFn } from '@storybook/react'
-import { HttpResponse, delay } from 'msw'
-import { useEffect } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
-import { userLogic } from 'scenes/userLogic'
-
-import { mswDecorator, useStorybookMocks } from '~/mocks/browser'
-import preflightJson from '~/mocks/fixtures/_preflight.json'
-
-import { SignupContainer } from './SignupContainer'
-import { signupLogic } from './signupForm/signupLogic'
-
-type PanelOption = '1: Email' | '2: Password' | '3: Profile'
-
-const PANEL_INDEX: Record<PanelOption, 0 | 1 | 2> = {
- '1: Email': 0,
- '2: Password': 1,
- '3: Profile': 2,
-}
-
-type StoryArgs = {
- cloud: boolean
- region: 'US' | 'EU'
- googleOAuth: boolean
- github: boolean
- gitlab: boolean
- panel: PanelOption
-}
-
-const meta: Meta<StoryArgs> = {
- title: 'Scenes-Other/Signup (glass)',
- tags: ['test-skip'],
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- featureFlags: {
- [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'glass',
- },
- },
- decorators: [
- mswDecorator({
- get: { '/api/users/@me': () => [500, null] },
- post: {
- '/api/signup': async () => {
- await delay(1000)
- return HttpResponse.json({ success: true })
- },
- },
- }),
- ],
- argTypes: {
- cloud: { control: 'boolean', name: 'Cloud' },
- region: { control: 'select', options: ['US', 'EU'], name: 'Region', if: { arg: 'cloud' } },
- googleOAuth: { control: 'boolean', name: 'Google OAuth' },
- github: { control: 'boolean', name: 'GitHub' },
- gitlab: { control: 'boolean', name: 'GitLab' },
- panel: {
- control: 'select',
- name: 'Step',
- options: ['1: Email', '2: Password', '3: Profile'] satisfies PanelOption[],
- },
- },
- args: {
- cloud: true,
- region: 'US',
- googleOAuth: true,
- github: true,
- gitlab: true,
- panel: '1: Email',
- },
-}
-export default meta
-
-const Template: StoryFn<StoryArgs> = ({ cloud, region, googleOAuth, github, gitlab, panel: panelOption }) => {
- const panel = PANEL_INDEX[panelOption]
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud,
- region: cloud ? region : undefined,
- realm: cloud ? 'cloud' : 'hosted-clickhouse',
- is_debug: cloud,
- can_create_org: cloud,
- available_social_auth_providers: {
- 'google-oauth2': googleOAuth,
- github,
- gitlab,
- saml: false,
- },
- },
- },
- })
-
- useDelayedOnMountEffect(() => userLogic.actions.loadUserSuccess(null))
-
- useEffect(() => {
- signupLogic.actions.setPanel(panel)
- if (panel > 0) {
- signupLogic.actions.setSignupPanelEmailValue('email', '[email protected]')
- }
- }, [panel])
-
- return <SignupContainer />
-}
-
-export const Default: StoryFn<StoryArgs> = Template.bind({})
-
-export const SelfHosted: StoryFn<StoryArgs> = Template.bind({})
-SelfHosted.args = { cloud: false, googleOAuth: false, github: false, gitlab: false }
-
-export const PasswordStep: StoryFn<StoryArgs> = Template.bind({})
-PasswordStep.args = { panel: '2: Password' }
-
-export const ProfileStep: StoryFn<StoryArgs> = Template.bind({})
-ProfileStep.args = { panel: '3: Profile' }
diff --git a/frontend/src/scenes/authentication/signup/PaperDeskSignup.stories.tsx b/frontend/src/scenes/authentication/signup/PaperDeskSignup.stories.tsx
deleted file mode 100644
index d8939b7f93b9..000000000000
--- a/frontend/src/scenes/authentication/signup/PaperDeskSignup.stories.tsx
+++ /dev/null
@@ -1,118 +0,0 @@
-import type { Meta, StoryFn } from '@storybook/react'
-import { HttpResponse, delay } from 'msw'
-import { useEffect } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
-import { userLogic } from 'scenes/userLogic'
-
-import { mswDecorator, useStorybookMocks } from '~/mocks/browser'
-import preflightJson from '~/mocks/fixtures/_preflight.json'
-
-import { SignupContainer } from './SignupContainer'
-import { signupLogic } from './signupForm/signupLogic'
-
-type PanelOption = '1 — Email' | '2 — Password' | '3 — Profile'
-
-const PANEL_INDEX: Record<PanelOption, 0 | 1 | 2> = {
- '1 — Email': 0,
- '2 — Password': 1,
- '3 — Profile': 2,
-}
-
-type StoryArgs = {
- cloud: boolean
- region: 'US' | 'EU'
- googleOAuth: boolean
- github: boolean
- gitlab: boolean
- panel: PanelOption
-}
-
-const meta: Meta<StoryArgs> = {
- title: 'Scenes-Other/Signup (paper-desk)',
- tags: ['test-skip'],
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- featureFlags: {
- [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'paper-desk',
- },
- },
- decorators: [
- mswDecorator({
- get: { '/api/users/@me': () => [500, null] },
- post: {
- '/api/signup': async () => {
- await delay(1000)
- return HttpResponse.json({ success: true })
- },
- },
- }),
- ],
- argTypes: {
- cloud: { control: 'boolean', name: 'Cloud' },
- region: { control: 'select', options: ['US', 'EU'], name: 'Region', if: { arg: 'cloud' } },
- googleOAuth: { control: 'boolean', name: 'Google OAuth' },
- github: { control: 'boolean', name: 'GitHub' },
- gitlab: { control: 'boolean', name: 'GitLab' },
- panel: {
- control: 'select',
- name: 'Step',
- options: ['1 — Email', '2 — Password', '3 — Profile'] satisfies PanelOption[],
- },
- },
- args: {
- cloud: true,
- region: 'US',
- googleOAuth: true,
- github: true,
- gitlab: true,
- panel: '1 — Email',
- },
-}
-export default meta
-
-const Template: StoryFn<StoryArgs> = ({ cloud, region, googleOAuth, github, gitlab, panel: panelOption }) => {
- const panel = PANEL_INDEX[panelOption]
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud,
- region: cloud ? region : undefined,
- realm: cloud ? 'cloud' : 'hosted-clickhouse',
- is_debug: cloud,
- can_create_org: cloud,
- available_social_auth_providers: {
- 'google-oauth2': googleOAuth,
- github,
- gitlab,
- saml: false,
- },
- },
- },
- })
-
- useDelayedOnMountEffect(() => userLogic.actions.loadUserSuccess(null))
-
- useEffect(() => {
- signupLogic.actions.setPanel(panel)
- if (panel > 0) {
- signupLogic.actions.setSignupPanelEmailValue('email', '[email protected]')
- }
- }, [panel])
-
- return <SignupContainer />
-}
-
-export const Default: StoryFn<StoryArgs> = Template.bind({})
-
-export const SelfHosted: StoryFn<StoryArgs> = Template.bind({})
-SelfHosted.args = { cloud: false, googleOAuth: false, github: false, gitlab: false }
-
-export const PasswordStep: StoryFn<StoryArgs> = Template.bind({})
-PasswordStep.args = { panel: '2 — Password' }
-
-export const ProfileStep: StoryFn<StoryArgs> = Template.bind({})
-ProfileStep.args = { panel: '3 — Profile' }
diff --git a/frontend/src/scenes/authentication/signup/Signup.stories.tsx b/frontend/src/scenes/authentication/signup/Signup.stories.tsx
index 63696684b529..f93a838d1363 100644
--- a/frontend/src/scenes/authentication/signup/Signup.stories.tsx
+++ b/frontend/src/scenes/authentication/signup/Signup.stories.tsx
@@ -1,5 +1,6 @@
-import { Meta, StoryObj } from '@storybook/react'
+import type { Meta, StoryFn } from '@storybook/react'
import { HttpResponse, delay } from 'msw'
+import { useEffect } from 'react'
import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
import { userLogic } from 'scenes/userLogic'
@@ -7,10 +8,29 @@ import { userLogic } from 'scenes/userLogic'
import { mswDecorator, useStorybookMocks } from '~/mocks/browser'
import preflightJson from '~/mocks/fixtures/_preflight.json'
-import { SignupContainer } from './SignupContainer'
+import { Signup } from './Signup'
+import { signupLogic } from './signupForm/signupLogic'
-const meta: Meta = {
+type PanelOption = '1: Email' | '2: Password' | '3: Profile'
+
+const PANEL_INDEX: Record<PanelOption, 0 | 1 | 2> = {
+ '1: Email': 0,
+ '2: Password': 1,
+ '3: Profile': 2,
+}
+
+type StoryArgs = {
+ cloud: boolean
+ region: 'US' | 'EU'
+ googleOAuth: boolean
+ github: boolean
+ gitlab: boolean
+ panel: PanelOption
+}
+
+const meta: Meta<StoryArgs> = {
title: 'Scenes-Other/Signup',
+ tags: ['test-skip'],
parameters: {
layout: 'fullscreen',
viewMode: 'story',
@@ -26,74 +46,69 @@ const meta: Meta = {
},
}),
],
+ argTypes: {
+ cloud: { control: 'boolean', name: 'Cloud' },
+ region: { control: 'select', options: ['US', 'EU'], name: 'Region', if: { arg: 'cloud' } },
+ googleOAuth: { control: 'boolean', name: 'Google OAuth' },
+ github: { control: 'boolean', name: 'GitHub' },
+ gitlab: { control: 'boolean', name: 'GitLab' },
+ panel: {
+ control: 'select',
+ name: 'Step',
+ options: ['1: Email', '2: Password', '3: Profile'] satisfies PanelOption[],
+ },
+ },
+ args: {
+ cloud: true,
+ region: 'US',
+ googleOAuth: true,
+ github: true,
+ gitlab: true,
+ panel: '1: Email',
+ },
}
export default meta
-type Story = StoryObj<{}>
-
-export const SelfHosted: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: false,
- realm: 'hosted-clickhouse',
- available_social_auth_providers: {
- github: false,
- gitlab: false,
- 'google-oauth2': false,
- saml: false,
- },
+const Template: StoryFn<StoryArgs> = ({ cloud, region, googleOAuth, github, gitlab, panel: panelOption }) => {
+ const panel = PANEL_INDEX[panelOption]
+ useStorybookMocks({
+ get: {
+ '/_preflight': {
+ ...preflightJson,
+ cloud,
+ region: cloud ? region : undefined,
+ realm: cloud ? 'cloud' : 'hosted-clickhouse',
+ is_debug: cloud,
+ can_create_org: cloud,
+ available_social_auth_providers: {
+ 'google-oauth2': googleOAuth,
+ github,
+ gitlab,
+ saml: false,
},
},
- })
-
- useDelayedOnMountEffect(() => userLogic.actions.loadUserSuccess(null))
-
- return <SignupContainer />
- },
-}
+ },
+ })
-export const SelfHostedSSO: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: false,
- realm: 'hosted-clickhouse',
- available_social_auth_providers: { github: true, gitlab: true, 'google-oauth2': true, saml: true },
- },
- },
- })
+ useDelayedOnMountEffect(() => userLogic.actions.loadUserSuccess(null))
- useDelayedOnMountEffect(() => userLogic.actions.loadUserSuccess(null))
+ useEffect(() => {
+ signupLogic.actions.setPanel(panel)
+ if (panel > 0) {
+ signupLogic.actions.setSignupPanelEmailValue('email', '[email protected]')
+ }
+ }, [panel])
- return <SignupContainer />
- },
+ return <Signup />
}
-export const Cloud: Story = {
- render: () => {
- useStorybookMocks({
- get: {
- '/_preflight': {
- ...preflightJson,
- cloud: true,
- realm: 'cloud',
- available_social_auth_providers: {
- github: false,
- gitlab: false,
- 'google-oauth2': false,
- saml: false,
- },
- },
- },
- })
+export const Default: StoryFn<StoryArgs> = Template.bind({})
- useDelayedOnMountEffect(() => userLogic.actions.loadUserSuccess(null))
+export const SelfHosted: StoryFn<StoryArgs> = Template.bind({})
+SelfHosted.args = { cloud: false, googleOAuth: false, github: false, gitlab: false }
- return <SignupContainer />
- },
-}
+export const PasswordStep: StoryFn<StoryArgs> = Template.bind({})
+PasswordStep.args = { panel: '2: Password' }
+
+export const ProfileStep: StoryFn<StoryArgs> = Template.bind({})
+ProfileStep.args = { panel: '3: Profile' }
diff --git a/frontend/src/scenes/authentication/signup/variants/paper-desk/PaperDeskSignup.tsx b/frontend/src/scenes/authentication/signup/Signup.tsx
similarity index 92%
rename from frontend/src/scenes/authentication/signup/variants/paper-desk/PaperDeskSignup.tsx
rename to frontend/src/scenes/authentication/signup/Signup.tsx
index 2d6e9b3bacc4..ff6cef56b16b 100644
--- a/frontend/src/scenes/authentication/signup/variants/paper-desk/PaperDeskSignup.tsx
+++ b/frontend/src/scenes/authentication/signup/Signup.tsx
@@ -13,16 +13,21 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonInput } from 'lib/lemon-ui/LemonInput/LemonInput'
import { Link } from 'lib/lemon-ui/Link'
-import { CardTitle } from 'scenes/authentication/shared/paperDesk/CardTitle'
-import { PaperDeskCard, PaperDeskScene } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'
-import { RegionField } from 'scenes/authentication/shared/paperDesk/RegionField'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
+import { RegionField } from 'scenes/authentication/shared/authScene/RegionField'
import { TurnstileChallenge } from 'scenes/authentication/signup/signupForm/TurnstileChallenge'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
+import { SceneExport } from 'scenes/sceneTypes'
import { userLogic } from 'scenes/userLogic'
import { LoginMethod } from '~/types'
-import { signupLogic } from '../../signupForm/signupLogic'
+import { signupLogic } from './signupForm/signupLogic'
+
+export const scene: SceneExport = {
+ component: Signup,
+}
// Bare text nodes below are wrapped in <span>s: Chrome's in-page translation replaces text
// nodes with <font> elements, which crashes React's sibling insert/remove operations
@@ -60,8 +65,8 @@ function SignupEmailPanel(): JSX.Element {
)
return (
- <PaperDeskCard footer={footer}>
- <CardTitle title="Get started" sub="Make your product self-driving." />
+ <AuthSceneCard footer={footer}>
+ <AuthCardTitle title="Get started" sub="Make your product self-driving." />
<Form logic={signupLogic} formKey="signupPanelEmail" enableFormOnSubmit className="flex flex-col gap-4">
<RegionField />
<LemonField
@@ -87,6 +92,7 @@ function SignupEmailPanel(): JSX.Element {
</LemonField>
{accountExists && (
<p className="text-xs text-danger -mt-2">
+ <span>{signupPanelEmailManualErrors.email}</span>{' '}
<Link
to={loginUrl}
className="font-semibold no-underline cursor-pointer hover:underline hover:underline-offset-2 text-warning"
@@ -126,14 +132,14 @@ function SignupEmailPanel(): JSX.Element {
Trying to join an existing organization?
</button>
{showJoinOrg && (
- <p className="PaperDesk__note mt-3 py-3 px-3.5 text-xs leading-relaxed text-secondary text-left bg-[#fbfbf9] border border-dashed border-[#c5c6bd] rounded">
+ <p className="AuthScene__note mt-3 py-3 px-3.5 text-xs leading-relaxed text-secondary text-left bg-[#fbfbf9] border border-dashed border-[#c5c6bd] rounded">
You'll need your invite link. When a teammate invites you, we email you a personal link.
Didn't get one? Check spam, or ask them to resend it from their members settings.
</p>
)}
</div>
)}
- </PaperDeskCard>
+ </AuthSceneCard>
)
}
@@ -143,13 +149,13 @@ function PendingInvitePanel(): JSX.Element {
const org = pendingInvite?.organization_name ?? 'your team'
return (
- <PaperDeskCard>
- <CardTitle
+ <AuthSceneCard>
+ <AuthCardTitle
title="You've already been invited"
sub={
<span>
<b className="text-primary">{org}</b> <span>invited</span>{' '}
- <span className="PaperDesk__mono">{signupPanelEmail.email}</span>{' '}
+ <span className="AuthScene__mono">{signupPanelEmail.email}</span>{' '}
<span>to join them on PostHog. The invite link is in your inbox.</span>
</span>
}
@@ -184,7 +190,7 @@ function PendingInvitePanel(): JSX.Element {
</LemonButton>
</div>
)}
- </PaperDeskCard>
+ </AuthSceneCard>
)
}
@@ -202,7 +208,7 @@ function SignupAuthPanel(): JSX.Element {
const footer = (
<>
- <p className="PaperDesk__terms mt-5 mb-0 text-xs leading-relaxed text-tertiary text-center">
+ <p className="AuthScene__terms mt-5 mb-0 text-xs leading-relaxed text-tertiary text-center">
<span>By creating an account, you agree to our</span>{' '}
<Link to="https://posthog.com/terms" target="_blank">
Terms of Service ↗
@@ -225,12 +231,12 @@ function SignupAuthPanel(): JSX.Element {
)
return (
- <PaperDeskCard footer={footer}>
- <CardTitle
+ <AuthSceneCard footer={footer}>
+ <AuthCardTitle
title="Secure your account"
sub={
<span>
- <span>Signing up as</span> <span className="PaperDesk__mono">{signupPanelEmail.email}</span>
+ <span>Signing up as</span> <span className="AuthScene__mono">{signupPanelEmail.email}</span>
</span>
}
/>
@@ -240,7 +246,7 @@ function SignupAuthPanel(): JSX.Element {
</div>
)}
{passkeyRegistered ? (
- <div className="PaperDesk__note text-center py-3 px-3.5 text-xs leading-relaxed text-secondary bg-[#fbfbf9] border border-dashed border-[#c5c6bd] rounded">
+ <div className="AuthScene__note text-center py-3 px-3.5 text-xs leading-relaxed text-secondary bg-[#fbfbf9] border border-dashed border-[#c5c6bd] rounded">
Passkey registered. Continue below.
</div>
) : (
@@ -308,7 +314,7 @@ function SignupAuthPanel(): JSX.Element {
Create account
</LemonButton>
</Form>
- </PaperDeskCard>
+ </AuthSceneCard>
)
}
@@ -334,7 +340,7 @@ function SignupProfilePanel(): JSX.Element {
const footer = (
<>
- <p className="PaperDesk__terms mt-5 mb-0 text-xs leading-relaxed text-tertiary text-center">
+ <p className="AuthScene__terms mt-5 mb-0 text-xs leading-relaxed text-tertiary text-center">
<span>
By {preflight?.demo ? 'entering the demo environment' : 'creating an account'}, you agree to our
</span>{' '}
@@ -361,13 +367,13 @@ function SignupProfilePanel(): JSX.Element {
)
return (
- <PaperDeskCard footer={footer}>
- <CardTitle
+ <AuthSceneCard footer={footer}>
+ <AuthCardTitle
title="Tell us about yourself"
sub={
<span>
<span>Setting up the account for</span>{' '}
- <span className="PaperDesk__mono">{signupPanelEmail.email}</span>
+ <span className="AuthScene__mono">{signupPanelEmail.email}</span>
</span>
}
/>
@@ -454,11 +460,11 @@ function SignupProfilePanel(): JSX.Element {
</LemonButton>
)}
</Form>
- </PaperDeskCard>
+ </AuthSceneCard>
)
}
-function Signup(): JSX.Element | null {
+export function Signup(): JSX.Element | null {
const { user } = useValues(userLogic)
const { panel } = useValues(signupLogic)
@@ -467,10 +473,8 @@ function Signup(): JSX.Element | null {
}
return (
- <PaperDeskScene notes={NOTES[panel] ?? NOTES[0]}>
+ <AuthScene notes={NOTES[panel] ?? NOTES[0]}>
{panel === 0 ? <SignupEmailPanel /> : panel === 1 ? <SignupAuthPanel /> : <SignupProfilePanel />}
- </PaperDeskScene>
+ </AuthScene>
)
}
-
-export { Signup as PaperDeskSignup }
diff --git a/frontend/src/scenes/authentication/signup/SignupContainer.tsx b/frontend/src/scenes/authentication/signup/SignupContainer.tsx
deleted file mode 100644
index 23e036a837db..000000000000
--- a/frontend/src/scenes/authentication/signup/SignupContainer.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { useValues } from 'kea'
-
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { SceneExport } from 'scenes/sceneTypes'
-
-import { authFlowVariantRegistry } from '../authFlowVariantRegistry'
-import { resolveAuthFlowVariant } from '../authFlowVariants'
-
-export const scene: SceneExport = {
- component: SignupContainer,
-}
-
-export function SignupContainer(): JSX.Element | null {
- const { featureFlags } = useValues(featureFlagLogic)
- const { Signup: VariantSignup } = authFlowVariantRegistry[resolveAuthFlowVariant(featureFlags)]
- return <VariantSignup />
-}
diff --git a/frontend/src/scenes/authentication/signup/variants/glass/GlassSignup.tsx b/frontend/src/scenes/authentication/signup/variants/glass/GlassSignup.tsx
deleted file mode 100644
index 206d70bbce84..000000000000
--- a/frontend/src/scenes/authentication/signup/variants/glass/GlassSignup.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { PaperDeskThemeProvider } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'
-
-import { PaperDeskSignup } from '../paper-desk/PaperDeskSignup'
-
-/** The paper-desk page re-skinned with posthog.com's garden design language - behavior unchanged. */
-export function GlassSignup(): JSX.Element {
- return (
- <PaperDeskThemeProvider theme="glass">
- <PaperDeskSignup />
- </PaperDeskThemeProvider>
- )
-}
diff --git a/frontend/src/scenes/authentication/signup/variants/legacy/LegacySignup.tsx b/frontend/src/scenes/authentication/signup/variants/legacy/LegacySignup.tsx
deleted file mode 100644
index 028b4dae2839..000000000000
--- a/frontend/src/scenes/authentication/signup/variants/legacy/LegacySignup.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-import { useValues } from 'kea'
-import { router } from 'kea-router'
-
-import { IconCheckCircle } from '@posthog/icons'
-
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import { CLOUD_HOSTNAMES, FEATURE_FLAGS } from 'lib/constants'
-import { Link } from 'lib/lemon-ui/Link'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
-import { userLogic } from 'scenes/userLogic'
-
-import { Region } from '~/types'
-
-import { SignupForm } from '../../signupForm/SignupForm'
-
-function Signup(): JSX.Element | null {
- const { preflight } = useValues(preflightLogic)
- const { user } = useValues(userLogic)
- const { featureFlags } = useValues(featureFlagLogic)
-
- const signupAATestVariant = featureFlags[FEATURE_FLAGS.SIGNUP_AA_TEST_4_WAY]
-
- const footerHighlights = {
- cloud: ['Hosted & managed by PostHog', 'Pay per event, cancel anytime', 'Fast and reliable support'],
- selfHosted: ['Fully featured product, unlimited events', 'Data in your own infrastructure', 'Community forum'],
- }
-
- return !user ? (
- <BridgePage
- view="signup"
- sideLogo
- leftContainerContent={<SignupLeftContainer />}
- footer={
- <div className="sm:flex sm:justify-center w-full gap-[10%]">
- {footerHighlights[preflight?.cloud ? 'cloud' : 'selfHosted'].map((val, idx) => (
- <p key={idx} className="text-center mb-2">
- {val}
- </p>
- ))}
- </div>
- }
- >
- {typeof signupAATestVariant === 'string' && (
- <div data-attr="signup-aa-test-variant" data-variant={signupAATestVariant} className="hidden" />
- )}
- <SignupForm />
- </BridgePage>
- ) : null
-}
-
-const productBenefits = [
- {
- benefit: 'Free usage every month - even on paid plans',
- description: '1M free events, 5K free session recordings, and more. Every month. Forever.',
- },
- {
- benefit: 'Start collecting data immediately',
- description: 'Integrate with developer-friendly APIs or a low-code web snippet.',
- },
- {
- benefit: 'Join industry leaders that run on PostHog',
- description: 'Airbus, Hasura, Y Combinator, Staples, and thousands more trust PostHog as their Product OS.',
- },
-]
-
-export function SignupLeftContainer(): JSX.Element {
- const { preflight } = useValues(preflightLogic)
-
- const getRegionUrl = (region: Region): string => {
- const { pathname, search, hash } = router.values.currentLocation
- return `https://${CLOUD_HOSTNAMES[region]}${pathname}${search}${hash}`
- }
-
- return (
- <>
- <div className="mb-16 max-w-100">
- {productBenefits.map((benefit, i) => (
- <div className="flex flex-row gap-3 mb-4" key={i}>
- <div>
- <IconCheckCircle className="mt-0.5 w-5 h-5 text-link" />
- </div>
- <div>
- <h3 className="mb-1 font-bold leading-6">{benefit.benefit}</h3>
- <p className="m-0 text-sm">{benefit.description}</p>
- </div>
- </div>
- ))}
- </div>
- <div className="BridgePage__cta border rounded p-4 mt-8 text-center">
- Did you know?
- {preflight?.cloud ? (
- <span>
- {' '}
- You can use our{' '}
- <Link to={getRegionUrl(preflight?.region === Region.EU ? Region.US : Region.EU)}>
- <strong>PostHog Cloud {preflight?.region === Region.EU ? 'US' : 'EU'}</strong>
- </Link>
- {preflight?.region === Region.EU ? ', too' : ' for a GDPR-ready deployment'}.
- </span>
- ) : (
- <span>
- {' '}
- You can use our{' '}
- <Link to={getRegionUrl(Region.EU)}>
- <strong>{Region.EU} cloud</strong>
- </Link>{' '}
- or{' '}
- <Link to={getRegionUrl(Region.US)}>
- <strong>{Region.US} cloud</strong>
- </Link>{' '}
- and we'll take care of the hosting for you.
- </span>
- )}
- </div>
- </>
- )
-}
-
-export { Signup as LegacySignup }
diff --git a/frontend/src/scenes/authentication/verify-email/GlassVerifyEmail.stories.tsx b/frontend/src/scenes/authentication/verify-email/GlassVerifyEmail.stories.tsx
deleted file mode 100644
index 360f4bbfada3..000000000000
--- a/frontend/src/scenes/authentication/verify-email/GlassVerifyEmail.stories.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import type { Meta, StoryFn } from '@storybook/react'
-import { useEffect } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-
-import { useStorybookMocks } from '~/mocks/browser'
-import preflightJson from '~/mocks/fixtures/_preflight.json'
-
-import { VerifyEmail } from './VerifyEmail'
-import { verifyEmailLogic } from './verifyEmailLogic'
-
-type VerifyEmailView = 'pending' | 'verify' | 'success' | 'invalid'
-
-type StoryArgs = {
- view: VerifyEmailView
-}
-
-const meta: Meta<StoryArgs> = {
- title: 'Scenes-Other/Verify Email (glass)',
- tags: ['test-skip'],
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'glass' },
- },
- argTypes: {
- view: {
- control: 'select',
- name: 'View',
- options: ['pending', 'verify', 'success', 'invalid'] satisfies VerifyEmailView[],
- },
- },
- args: {
- view: 'pending',
- },
-}
-export default meta
-
-const Template: StoryFn<StoryArgs> = ({ view }) => {
- useStorybookMocks({
- get: {
- '/_preflight': { ...preflightJson },
- '/api/users/@me': () => [200, { email: '[email protected]', first_name: 'Test' }],
- },
- })
-
- useEffect(() => {
- verifyEmailLogic.actions.setView(view)
- verifyEmailLogic.actions.setUuid('12345678')
- }, [view])
-
- return <VerifyEmail />
-}
-
-export const Default: StoryFn<StoryArgs> = Template.bind({})
-
-export const Pending: StoryFn<StoryArgs> = Template.bind({})
-Pending.args = { view: 'pending' }
-
-export const Verifying: StoryFn<StoryArgs> = Template.bind({})
-Verifying.args = { view: 'verify' }
-Verifying.parameters = { testOptions: { waitForLoadersToDisappear: false } }
-
-export const Success: StoryFn<StoryArgs> = Template.bind({})
-Success.args = { view: 'success' }
-
-export const InvalidLink: StoryFn<StoryArgs> = Template.bind({})
-InvalidLink.args = { view: 'invalid' }
diff --git a/frontend/src/scenes/authentication/verify-email/PaperDeskVerifyEmail.stories.tsx b/frontend/src/scenes/authentication/verify-email/PaperDeskVerifyEmail.stories.tsx
deleted file mode 100644
index 5f98ccc5d581..000000000000
--- a/frontend/src/scenes/authentication/verify-email/PaperDeskVerifyEmail.stories.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import type { Meta, StoryFn } from '@storybook/react'
-import { useEffect } from 'react'
-
-import { FEATURE_FLAGS } from 'lib/constants'
-
-import { useStorybookMocks } from '~/mocks/browser'
-import preflightJson from '~/mocks/fixtures/_preflight.json'
-
-import { VerifyEmail } from './VerifyEmail'
-import { verifyEmailLogic } from './verifyEmailLogic'
-
-type VerifyEmailView = 'pending' | 'verify' | 'success' | 'invalid'
-
-type StoryArgs = {
- view: VerifyEmailView
-}
-
-const meta: Meta<StoryArgs> = {
- title: 'Scenes-Other/Verify Email (paper-desk)',
- tags: ['test-skip'],
- parameters: {
- layout: 'fullscreen',
- viewMode: 'story',
- featureFlags: { [FEATURE_FLAGS.AUTH_FLOW_VARIANT]: 'paper-desk' },
- },
- argTypes: {
- view: {
- control: 'select',
- name: 'View',
- options: ['pending', 'verify', 'success', 'invalid'] satisfies VerifyEmailView[],
- },
- },
- args: {
- view: 'pending',
- },
-}
-export default meta
-
-const Template: StoryFn<StoryArgs> = ({ view }) => {
- useStorybookMocks({
- get: {
- '/_preflight': { ...preflightJson },
- '/api/users/@me': () => [200, { email: '[email protected]', first_name: 'Test' }],
- },
- })
-
- useEffect(() => {
- verifyEmailLogic.actions.setView(view)
- verifyEmailLogic.actions.setUuid('12345678')
- }, [view])
-
- return <VerifyEmail />
-}
-
-export const Default: StoryFn<StoryArgs> = Template.bind({})
-
-export const Pending: StoryFn<StoryArgs> = Template.bind({})
-Pending.args = { view: 'pending' }
-
-export const Verifying: StoryFn<StoryArgs> = Template.bind({})
-Verifying.args = { view: 'verify' }
-Verifying.parameters = { testOptions: { waitForLoadersToDisappear: false } }
-
-export const Success: StoryFn<StoryArgs> = Template.bind({})
-Success.args = { view: 'success' }
-
-export const InvalidLink: StoryFn<StoryArgs> = Template.bind({})
-InvalidLink.args = { view: 'invalid' }
diff --git a/frontend/src/scenes/authentication/verify-email/VerifyEmail.stories.tsx b/frontend/src/scenes/authentication/verify-email/VerifyEmail.stories.tsx
index 80f5108394b3..07792140c24c 100644
--- a/frontend/src/scenes/authentication/verify-email/VerifyEmail.stories.tsx
+++ b/frontend/src/scenes/authentication/verify-email/VerifyEmail.stories.tsx
@@ -1,63 +1,65 @@
-import type { Meta, StoryObj } from '@storybook/react'
+import type { Meta, StoryFn } from '@storybook/react'
+import { useEffect } from 'react'
-import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'
+import { useStorybookMocks } from '~/mocks/browser'
+import preflightJson from '~/mocks/fixtures/_preflight.json'
import { VerifyEmail } from './VerifyEmail'
import { verifyEmailLogic } from './verifyEmailLogic'
-const meta: Meta = {
+type VerifyEmailView = 'pending' | 'verify' | 'success' | 'invalid'
+
+type StoryArgs = {
+ view: VerifyEmailView
+}
+
+const meta: Meta<StoryArgs> = {
title: 'Scenes-Other/Verify Email',
+ tags: ['test-skip'],
parameters: {
layout: 'fullscreen',
viewMode: 'story',
},
+ argTypes: {
+ view: {
+ control: 'select',
+ name: 'View',
+ options: ['pending', 'verify', 'success', 'invalid'] satisfies VerifyEmailView[],
+ },
+ },
+ args: {
+ view: 'pending',
+ },
}
export default meta
-type Story = StoryObj<{}>
-
-export const VerifyEmailPending: Story = {
- render: () => {
- useDelayedOnMountEffect(() => {
- verifyEmailLogic.actions.setView('pending')
- verifyEmailLogic.actions.setUuid('12345678')
- })
- return <VerifyEmail />
- },
-}
+const Template: StoryFn<StoryArgs> = ({ view }) => {
+ useStorybookMocks({
+ get: {
+ '/_preflight': { ...preflightJson },
+ '/api/users/@me': () => [200, { email: '[email protected]', first_name: 'Test' }],
+ },
+ })
-export const VerifyingEmail: Story = {
- render: () => {
- useDelayedOnMountEffect(() => {
- verifyEmailLogic.actions.setView('verify')
- })
+ useEffect(() => {
+ verifyEmailLogic.actions.setView(view)
+ verifyEmailLogic.actions.setUuid('12345678')
+ }, [view])
- return <VerifyEmail />
- },
- parameters: {
- testOptions: {
- waitForLoadersToDisappear: false,
- },
- },
+ return <VerifyEmail />
}
-export const VerifyEmailSuccess: Story = {
- render: () => {
- useDelayedOnMountEffect(() => {
- verifyEmailLogic.actions.setView('success')
- })
+export const Default: StoryFn<StoryArgs> = Template.bind({})
- return <VerifyEmail />
- },
-}
+export const Pending: StoryFn<StoryArgs> = Template.bind({})
+Pending.args = { view: 'pending' }
-export const VerifyEmailInvalid: Story = {
- render: () => {
- useDelayedOnMountEffect(() => {
- verifyEmailLogic.actions.setView('invalid')
- verifyEmailLogic.actions.setUuid('12345678')
- })
+export const Verifying: StoryFn<StoryArgs> = Template.bind({})
+Verifying.args = { view: 'verify' }
+Verifying.parameters = { testOptions: { waitForLoadersToDisappear: false } }
- return <VerifyEmail />
- },
-}
+export const Success: StoryFn<StoryArgs> = Template.bind({})
+Success.args = { view: 'success' }
+
+export const InvalidLink: StoryFn<StoryArgs> = Template.bind({})
+InvalidLink.args = { view: 'invalid' }
diff --git a/frontend/src/scenes/authentication/verify-email/VerifyEmail.tsx b/frontend/src/scenes/authentication/verify-email/VerifyEmail.tsx
index 2757ff04b92e..9d753566fc4a 100644
--- a/frontend/src/scenes/authentication/verify-email/VerifyEmail.tsx
+++ b/frontend/src/scenes/authentication/verify-email/VerifyEmail.tsx
@@ -1,10 +1,6 @@
-import { useValues } from 'kea'
-
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { SceneExport } from 'scenes/sceneTypes'
-import { authFlowVariantRegistry } from '../authFlowVariantRegistry'
-import { resolveAuthFlowVariant } from '../authFlowVariants'
+import { VerifyEmailForm } from './VerifyEmailForm'
import { verifyEmailLogic } from './verifyEmailLogic'
export const scene: SceneExport = {
@@ -13,7 +9,5 @@ export const scene: SceneExport = {
}
export function VerifyEmail(): JSX.Element {
- const { featureFlags } = useValues(featureFlagLogic)
- const { VerifyEmail: VariantVerifyEmail } = authFlowVariantRegistry[resolveAuthFlowVariant(featureFlags)]
- return <VariantVerifyEmail />
+ return <VerifyEmailForm />
}
diff --git a/frontend/src/scenes/authentication/verify-email/variants/paper-desk/PaperDeskVerifyEmail.tsx b/frontend/src/scenes/authentication/verify-email/VerifyEmailForm.tsx
similarity index 88%
rename from frontend/src/scenes/authentication/verify-email/variants/paper-desk/PaperDeskVerifyEmail.tsx
rename to frontend/src/scenes/authentication/verify-email/VerifyEmailForm.tsx
index 64fb8d06f520..5337c9ef3f0d 100644
--- a/frontend/src/scenes/authentication/verify-email/variants/paper-desk/PaperDeskVerifyEmail.tsx
+++ b/frontend/src/scenes/authentication/verify-email/VerifyEmailForm.tsx
@@ -9,10 +9,10 @@ import { supportLogic } from 'lib/components/Support/supportLogic'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { Link } from 'lib/lemon-ui/Link'
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
-import { PaperDeskCard, PaperDeskScene } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { urls } from 'scenes/urls'
-import { verifyEmailLogic } from '../../verifyEmailLogic'
+import { verifyEmailLogic } from './verifyEmailLogic'
const HedgehogMagnifyingGlass = pngHoggie(magnifyingGlassPng)
@@ -51,7 +51,7 @@ function NotSeeingIt(): JSX.Element {
Not seeing it?
</button>
{open && (
- <div className="PaperDesk__note mt-3 w-full py-3 px-3.5 text-xs leading-relaxed text-secondary text-left bg-[#fbfbf9] border border-dashed border-[#c5c6bd] rounded">
+ <div className="AuthScene__note mt-3 w-full py-3 px-3.5 text-xs leading-relaxed text-secondary text-left bg-[#fbfbf9] border border-dashed border-[#c5c6bd] rounded">
<p className="m-0 mb-2.5 font-semibold text-primary">Before we resend, three quick checks:</p>
<div className="flex flex-col gap-2">
{CHECKLIST.map((item, i) => (
@@ -105,7 +105,7 @@ function NotSeeingIt(): JSX.Element {
)
}
-function VerifyEmail(): JSX.Element {
+export function VerifyEmailForm(): JSX.Element {
const { view, uuid, newlyRequestedVerificationLinkLoading } = useValues(verifyEmailLogic)
const { requestVerificationLink } = useActions(verifyEmailLogic)
const { openSupportForm } = useActions(supportLogic)
@@ -114,30 +114,30 @@ function VerifyEmail(): JSX.Element {
if (view === 'success') {
return (
- <PaperDeskScene notes={notes}>
- <PaperDeskCard>
+ <AuthScene notes={notes}>
+ <AuthSceneCard>
<div className="flex flex-col items-center text-center">
<ExplorerHog className="block w-auto mx-auto h-32" />
<h1 className="m-0 mt-3 font-title text-2xl font-extrabold leading-tight text-primary text-center tracking-tight">
You're verified, go explore!
</h1>
- <p className="PaperDesk__sub mt-2 mb-5 text-sm text-secondary text-center text-pretty">
+ <p className="AuthScene__sub mt-2 mb-5 text-sm text-secondary text-center text-pretty">
Email confirmed. Next up: a quick setup. Your org, your team, your first events.
</p>
- <div className="PaperDesk__progress mb-4 w-full h-1.5 overflow-hidden bg-[#e0e1d9] rounded-sm">
- <div className="PaperDesk__progress-fill w-full h-full bg-warning rounded-sm" />
+ <div className="AuthScene__progress mb-4 w-full h-1.5 overflow-hidden bg-[#e0e1d9] rounded-sm">
+ <div className="AuthScene__progress-fill w-full h-full bg-warning rounded-sm" />
</div>
<p className="m-0 text-sm text-secondary text-center">Taking you to PostHog…</p>
</div>
- </PaperDeskCard>
- </PaperDeskScene>
+ </AuthSceneCard>
+ </AuthScene>
)
}
if (view === 'invalid') {
return (
- <PaperDeskScene notes={notes}>
- <PaperDeskCard
+ <AuthScene notes={notes}>
+ <AuthSceneCard
footer={
<p className="mt-5 mb-0 text-sm text-secondary text-center">
Already verified?{' '}
@@ -155,7 +155,7 @@ function VerifyEmail(): JSX.Element {
<h1 className="m-0 mt-3 font-title text-2xl font-extrabold leading-tight text-primary text-center tracking-tight">
This link fell asleep
</h1>
- <p className="PaperDesk__sub mt-2 mb-5 text-sm text-secondary text-center text-pretty">
+ <p className="AuthScene__sub mt-2 mb-5 text-sm text-secondary text-center text-pretty">
Verification links last 24 hours, and this one's past its bedtime. Request a fresh one and
we'll get you in.
</p>
@@ -186,30 +186,30 @@ function VerifyEmail(): JSX.Element {
</LemonButton>
</div>
</div>
- </PaperDeskCard>
- </PaperDeskScene>
+ </AuthSceneCard>
+ </AuthScene>
)
}
if (view === 'verify') {
return (
- <PaperDeskScene notes={notes}>
- <PaperDeskCard>
+ <AuthScene notes={notes}>
+ <AuthSceneCard>
<div className="flex flex-col items-center gap-4 text-center">
<Spinner className="text-4xl" />
- <p className="PaperDesk__sub m-0 text-sm text-secondary text-center text-pretty">
+ <p className="AuthScene__sub m-0 text-sm text-secondary text-center text-pretty">
Verifying your email address…
</p>
</div>
- </PaperDeskCard>
- </PaperDeskScene>
+ </AuthSceneCard>
+ </AuthScene>
)
}
// pending — check inbox
return (
- <PaperDeskScene notes={notes}>
- <PaperDeskCard
+ <AuthScene notes={notes}>
+ <AuthSceneCard
footer={
<p className="mt-5 mb-0 text-sm text-secondary text-center">
Wrong address?{' '}
@@ -227,14 +227,12 @@ function VerifyEmail(): JSX.Element {
<h1 className="m-0 mt-3 font-title text-2xl font-extrabold leading-tight text-primary text-center tracking-tight">
Check your inbox
</h1>
- <p className="PaperDesk__sub mt-2 mb-4 text-sm text-secondary text-center text-pretty">
+ <p className="AuthScene__sub mt-2 mb-4 text-sm text-secondary text-center text-pretty">
We sent you a verification link. Click the link inside and you're in. It's valid for 24 hours.
</p>
<NotSeeingIt />
</div>
- </PaperDeskCard>
- </PaperDeskScene>
+ </AuthSceneCard>
+ </AuthScene>
)
}
-
-export { VerifyEmail as PaperDeskVerifyEmail }
diff --git a/frontend/src/scenes/authentication/verify-email/variants/glass/GlassVerifyEmail.tsx b/frontend/src/scenes/authentication/verify-email/variants/glass/GlassVerifyEmail.tsx
deleted file mode 100644
index 8b9a285ff8ac..000000000000
--- a/frontend/src/scenes/authentication/verify-email/variants/glass/GlassVerifyEmail.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { PaperDeskThemeProvider } from 'scenes/authentication/shared/paperDesk/PaperDeskScene'
-
-import { PaperDeskVerifyEmail } from '../paper-desk/PaperDeskVerifyEmail'
-
-/** The paper-desk page re-skinned with posthog.com's garden design language - behavior unchanged. */
-export function GlassVerifyEmail(): JSX.Element {
- return (
- <PaperDeskThemeProvider theme="glass">
- <PaperDeskVerifyEmail />
- </PaperDeskThemeProvider>
- )
-}
diff --git a/frontend/src/scenes/authentication/verify-email/variants/legacy/LegacyVerifyEmail.tsx b/frontend/src/scenes/authentication/verify-email/variants/legacy/LegacyVerifyEmail.tsx
deleted file mode 100644
index 5a589cdbe955..000000000000
--- a/frontend/src/scenes/authentication/verify-email/variants/legacy/LegacyVerifyEmail.tsx
+++ /dev/null
@@ -1,191 +0,0 @@
-import '../../VerifyEmail.scss'
-
-import clsx from 'clsx'
-import { useActions, useValues } from 'kea'
-import { useState } from 'react'
-
-import * as shockedPng from '@posthog/brand/hoggies/png/shocked'
-import { LemonButton, LemonCheckbox, LemonModal, Link } from '@posthog/lemon-ui'
-
-import { pngHoggie } from 'lib/brand/hoggies'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import { HeartHog, MailHog } from 'lib/components/hedgehogs'
-import { supportLogic } from 'lib/components/Support/supportLogic'
-import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
-import { inStorybook, inStorybookTestRunner } from 'lib/utils/dom'
-import { urls } from 'scenes/urls'
-
-import { verifyEmailLogic } from '../../verifyEmailLogic'
-
-const HedgehogShocked = pngHoggie(shockedPng)
-
-interface SupportButtonsProps {
- disabledReason?: string
-}
-
-const SupportButtons = ({ disabledReason }: SupportButtonsProps): JSX.Element => {
- const { openSupportForm } = useActions(supportLogic)
- const { requestVerificationLink } = useActions(verifyEmailLogic)
- const { uuid } = useValues(verifyEmailLogic)
-
- return (
- <div className="flex flex-row gap-x-4 justify-start">
- <LemonButton
- type="primary"
- disabledReason={disabledReason}
- onClick={() => {
- openSupportForm({ kind: 'bug' })
- }}
- >
- Contact support
- </LemonButton>
- {uuid && (
- <LemonButton
- type="primary"
- disabledReason={disabledReason}
- onClick={() => {
- requestVerificationLink(uuid)
- }}
- >
- Request a new link
- </LemonButton>
- )}
- </div>
- )
-}
-
-export const VerifyEmailHelpLinks = (): JSX.Element => {
- const [checkListValues, setCheckListValues] = useState<boolean[]>([])
-
- const checklist = [
- 'Wait 5 minutes. Sometimes it takes a bit for email providers to deliver emails.',
- 'Check your spam folder and any firewalls you may have active',
- 'Ask your company IT department to allow any emails from @posthog.com',
- 'Channel your inner hedgehog and take another peek at your inbox',
- ]
-
- const handleChecklistChange = (index: number): void => {
- const newCheckListValues = [...checkListValues]
- newCheckListValues[index] = !newCheckListValues[index]
- setCheckListValues(newCheckListValues)
- }
-
- const allChecked = checklist.every((_, index) => checkListValues[index])
-
- return (
- <div className="bg-primary p-4 rounded relative w-full max-w-160">
- <div className="flex flex-col justify-center">
- <div className="deprecated-space-y-2 text-left">
- {checklist.map((item, index) => (
- <LemonCheckbox
- key={index}
- onChange={() => handleChecklistChange(index)}
- checked={checkListValues[index]}
- label={item}
- bordered
- size="small"
- />
- ))}
- </div>
- </div>
- <div className="mt-4">
- <p className="text-left mb-2">Choose one of the following options:</p>
- <SupportButtons
- disabledReason={!allChecked ? "Please confirm you've done all the steps above" : undefined}
- />
- </div>
- </div>
- )
-}
-
-const GetHelp = (): JSX.Element => {
- const [isOpen, setIsOpen] = useState(false)
- return (
- <>
- <LemonButton type="primary" onClick={() => setIsOpen(true)}>
- Get help
- </LemonButton>
- <LemonModal
- isOpen={isOpen}
- onClose={() => setIsOpen(false)}
- title="Get help"
- description={
- <p className="max-w-160">
- Sorry you're having troubles! We're here to help, but first we ask that you check a few things
- first on your end. Generally any issues with email happen after they leave our hands.
- </p>
- }
- >
- <VerifyEmailHelpLinks />
- </LemonModal>
- </>
- )
-}
-
-function VerifyEmail(): JSX.Element {
- const { view } = useValues(verifyEmailLogic)
-
- return (
- <div className="flex h-full flex-col">
- <div className="flex h-full">
- <BridgePage view="verifyEmail" fixedWidth={false}>
- <div className="px-12 py-8 text-center flex flex-col items-center max-w-160 w-full relative">
- {view === 'pending' ? (
- <>
- <h2 className="text-lg">Welcome to PostHog!</h2>
- <h1 className="text-3xl font-bold">Let's verify your email address.</h1>
- <div className="max-w-60 my-10">
- <MailHog className="w-full h-full" />
- </div>
- <p className="mb-6">An email has been sent with a link to verify your email address.</p>
- <GetHelp />
- </>
- ) : view === 'verify' ? (
- <>
- <Spinner className="text-4xl mb-12" />
- <p>Verifying your email address...</p>
- </>
- ) : view === 'success' ? (
- <>
- <h1 className="text-3xl font-bold">Success!</h1>
- <div className="max-w-60 mb-12">
- <HeartHog className="w-full h-full" />
- </div>
- <p>Thanks for verifying your email address. Now taking you to PostHog...</p>
- </>
- ) : view === 'invalid' ? (
- <>
- <h1 className="text-3xl font-bold">Whoops!</h1>
- <div className="max-w-60 mb-12">
- <HedgehogShocked className="w-full h-full" />
- </div>
- <p className="mb-6">Seems like that link isn't quite right. Try again?</p>
-
- <SupportButtons />
-
- <p className="text-xs text-muted mt-6">
- If you've already verified your email, then{' '}
- <Link to={urls.login()}>log in here</Link>.
- </p>
- </>
- ) : (
- <Spinner className="text-4xl" />
- )}
- {view === 'success' && (
- <div aria-hidden className="VerifyEmail__ProgressBar">
- <div
- className={clsx('VerifyEmail__ProgressBarTrack', {
- 'VerifyEmail__ProgressBarTrack--static':
- inStorybook() || inStorybookTestRunner(),
- })}
- />
- </div>
- )}
- </div>
- </BridgePage>
- </div>
- </div>
- )
-}
-
-export { VerifyEmail as LegacyVerifyEmail }
diff --git a/frontend/src/scenes/onboarding/self-driving/SelfDrivingOnboarding.scss b/frontend/src/scenes/onboarding/self-driving/SelfDrivingOnboarding.scss
index d7e5685e47c9..91781a7d8df1 100644
--- a/frontend/src/scenes/onboarding/self-driving/SelfDrivingOnboarding.scss
+++ b/frontend/src/scenes/onboarding/self-driving/SelfDrivingOnboarding.scss
@@ -3,10 +3,7 @@
background-color: var(--color-bg-surface-primary);
}
-// `sm`+ (≥640px): dotted paper grid + faint amber glow, copied from the paper-desk auth variant
-// (scenes/authentication/shared/paperDesk/PaperDesk.scss) so onboarding and sign-in/sign-up share the
// exact same backdrop. Multi-layer background (per-layer size/repeat), not achievable via Tailwind.
-// Unlike paper-desk (light-only), the base color lives here too so it can flip with the theme without
// competing against a Tailwind `bg-*` utility's cascade layer.
@media (min-width: 640px) {
// Experiment: posthog.com's garden look - layered greens with a soft light well behind the
@@ -24,7 +21,6 @@
16px 16px;
}
- // Onboarding also runs in dark mode (paper-desk is light-only), so swap the parchment base and
// invert the dot tint there. The grid geometry (1.4px dots, 16px cell) and amber glow are unchanged.
[theme='dark'] .OnboardingDottedBg {
background-color: var(--color-bg-surface-tertiary);
diff --git a/frontend/src/scenes/onboarding/self-driving/SelfDrivingOnboarding.tsx b/frontend/src/scenes/onboarding/self-driving/SelfDrivingOnboarding.tsx
index d63acba1d0d5..023c891cdfee 100644
--- a/frontend/src/scenes/onboarding/self-driving/SelfDrivingOnboarding.tsx
+++ b/frontend/src/scenes/onboarding/self-driving/SelfDrivingOnboarding.tsx
@@ -12,7 +12,6 @@ import { SelfDrivingOnboardingFlow } from './SelfDrivingOnboardingFlow'
export function SelfDrivingOnboarding(): JSX.Element | null {
return (
<div className="OnboardingDottedBg min-h-screen flex flex-col items-center justify-center p-4 sm:p-6">
- {/* Logo above the card, group centered (paper-desk positioning). Gradient in light, white in dark. */}
<span className="block mb-6">
<Logo size="lg" />
</span>
diff --git a/playwright/e2e/auth.spec.ts b/playwright/e2e/auth.spec.ts
index 970919970ab4..e2997c9c2a1e 100644
--- a/playwright/e2e/auth.spec.ts
+++ b/playwright/e2e/auth.spec.ts
@@ -77,8 +77,7 @@ test.describe('Auth', () => {
await expect(page.locator('[data-attr=password]')).toHaveValue('wrong password')
await loginPage.clickLogin()
- // Scope to the error banner: on cloud a separate info banner (OtherRegionHint) also renders here.
- await expect(page.locator('.LemonBanner--error')).toContainText('Invalid email or password.')
+ await expect(page.getByText('Invalid email or password.')).toBeVisible()
await loginPage.enterPassword(LOGIN_PASSWORD)
await loginPage.clickLogin()
diff --git a/posthog/management/commands/sync_feature_flags.py b/posthog/management/commands/sync_feature_flags.py
index 2158a7a2d6cd..2b77df2a75ad 100644
--- a/posthog/management/commands/sync_feature_flags.py
+++ b/posthog/management/commands/sync_feature_flags.py
@@ -22,7 +22,6 @@ INACTIVE_FLAGS = [
"halloween-override",
"christmas-override",
"control_support_login",
- "auth-flow-variant",
"person-property-incident-annotation-jan-2026",
"replay-exclude-from-hide-recordings-menu",
"webhooks-denylist",