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.

feat(auth): move every auth and logged-out screen onto AuthScene (#122862)

Rafael Audibert4d319e6a514d
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 2ffbcc486d70..ae5dc4597f9c 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -16213,37 +16213,37 @@ snapshots:
scenes-other-access-control-property-rules--saving-ai-property-rule--light:
hash: v1.k794b7964.f744b83a3b4cd755d46c352fdabb216ab0ab61227f5a27961d6ea7501a3ae57c.YZapjuaJVZzE1iuZjp9BdXY8XmjTxoMaVP8ANezY4Fg
scenes-other-account-connected--github-integration-connected--dark:
- hash: v1.k794b7964.fcae9b65af8160ba40bf82664dd9b5a6b9f5a1ddbdedee05bf15ec453eb7aa64.3616s9KNJancKVe-j4dQsJdo3W1CVcwWxRMA24QgU6Q
+ hash: v1.k794b7964.fcc98b5302a2541fb67493ccd8c0b80dcc9c540183f34774f35ec018d74e8469.hjRltMJmA8s_m01rAC1khKwV3p-GoAB0yrJlhqf7yfM
scenes-other-account-connected--github-integration-connected--light:
- hash: v1.k794b7964.8b287d932c7d89e4769d4d7a79205e51310541dc0cd1591812e2f2720fcd1dcf.OwYcgNvVm3W2msQK67UA0yi6X4skN-YvuKtoTJnvb3E
+ hash: v1.k794b7964.3c946d899b3d63f52436fc25d5f512e15db817195a1f47c0062dd0882a23c71a.J9fVdyw1l0blQKXRpo2HiKUXfuH1IXB6rgOuoAp8W6k
scenes-other-account-connected--github-integration-connected-from-chat--dark:
- hash: v1.k794b7964.535f7aeb801398ecf55500693f9ade1baf555ed733e4493101dac42b04056a45.Qed7usHliqMf7DFZcDg1LFuSUN04T1T8QeihUWgow4E
+ hash: v1.k794b7964.638963c1dfe07f8cfea2620060b44f2b83697668dbe4ed7b82a59fde5c936804.nJbFOVh3YM8AuHFtS46HT4COPLzZbK9JUnRCjVdnTgA
scenes-other-account-connected--github-integration-connected-from-chat--light:
- hash: v1.k794b7964.c5900005fd2031973261348080f18f7dfc81da66e4b31e13ad8c48f044b36b4e.H6Meweqjpk_OBydPJ_aiPUPZ7fbLluXeBCLsVPfL9aQ
+ hash: v1.k794b7964.d6194d5a07d9447a17fbc8086d33ba61af9966164fef4b30473f01808a696caf.31nK3ggfrhZL1Xm2hIbfDrGUuBEWHvS1aNB_cSSRdgs
scenes-other-account-connected--github-integration-failed--dark:
- hash: v1.k794b7964.d394cba800dc42d80f3b1cea7fb920d020cc2074c9e0b06e4974876b8a4cf318.K2N8s22_cesvI1EmzuVNW6fWS7uWkt1_mgBJdSgPalg
+ hash: v1.k794b7964.e5488fb7efedb197ab14773e3844b79982b8ae8868c22a9c2a992427be39d058.DwSXFCxGYBR0Wa1CKDbfeVBOKnytaCdngtDPiHeRQbY
scenes-other-account-connected--github-integration-failed--light:
- hash: v1.k794b7964.80ceb7909660009c7e03f12e2eacbe6a05ccd428779032966faeac8c84ad8a0e.XONQ2bh-fy2UnBPBQk0BNm_NeKsGNKgkUE2hRr4sOdE
+ hash: v1.k794b7964.6b56f91fcad14069a7334a40bd95c5e06fdc271067e260bf80ccae63b3140274.GYJb1ElKBs_qXpHx5g2ZZD6RmXTegQu_L2YcW6VzMJc
scenes-other-account-connected--github-integration-failed-from-chat--dark:
- hash: v1.k794b7964.4f68d57d3cfc6e7589b2f81b06382812e32d84d9b45eb77bba80508d4bd0cabe.HrkzbByynZUikG3LYSS8JtMmKIuG_0bQ0Mm51-MRlWk
+ hash: v1.k794b7964.0105e5bacfc11d09ac500773cbb2600a8186409f8fa5813cbd1179589c256fe2.7NWOw5AoVvMDhhK4vi0ffb_-W_UWj713uyW59oL5ilE
scenes-other-account-connected--github-integration-failed-from-chat--light:
- hash: v1.k794b7964.df35d0aff13d613800ece8dfee7bd97b78c54674d753732270c476654ef74460.M5tAWPwC8jqluUe00dMQpMhMK_Jryoi2lbkTgpsgWP4
+ hash: v1.k794b7964.5cd68f47c1ae5e13e62f6f220247c34c4de6fa3f2a9edbb42273b6a89c95b0fe.PcDCX4a7eTDFV0cTmWGsDJfWH1jCgUrNoU-ay2N4rYw
scenes-other-account-connected--github-integration-pending-from-chat--dark:
- hash: v1.k794b7964.f59a17f4e6940dc9d1f517d5db2a524699107090eb3af619055fb7b7b49601c0.bZ-GZ-VGWiB7hq4SA2EXMkMtawFOF6AJ8CEgDmjppMU
+ hash: v1.k794b7964.530ae6d18243f978d0f51e2509c880d07f8ba6e5f800ddf0785693b20a4f0907.S1mShj3wnjaBHheJKbNjs6AGSdoCpTkBIBhYRwy5cTY
scenes-other-account-connected--github-integration-pending-from-chat--light:
- hash: v1.k794b7964.3e09f863ec3ec65f4804c9dad2468e4204340ca2e874de8e175d0bf63b7c7128.WTl1lcIsYBtSO4z1eQxP7u5exvarTnpRq9Z2VGD5fjU
+ hash: v1.k794b7964.d13e64047af7e88c008579e8ef12fc542193f3e10d76242b17efab76b510a8cf.kkcU0wd1i-YzyKuNpZ4iKFeDslfI7nfRphXVnuO6zwM
scenes-other-account-connected--github-login-failed--dark:
- hash: v1.k794b7964.7d20c098085fe690be2109a71a37b40ac5fa763f0afd702aadbe9b3c712a8f7b.DAcCHbNqKQOtZ8sThEiIcQuUCYuAhp-x-nWzqDTCNqI
+ hash: v1.k794b7964.4d4b7d9fb1e6384c4aa18729a22c7f5b3b1db76cc20d8f960706c21544a86d24.D85NHqIx2W45miswcP0qGsKf2QVD5v9bu9pTEODENk4
scenes-other-account-connected--github-login-failed--light:
- hash: v1.k794b7964.43059b482edc0fcfa6949ceff1def3079cc3f6499e1d6b40ffb8a11768100cf9.ykoD4NfAU4poUf2yTNp9DlOw3hBPiJ3-iJiA07CJPn0
+ hash: v1.k794b7964.6f4ee56e78940b4647fdecdaba415c1aef74b8a12f7efbc6e0c96849472db5d3.l1adNGIE2A2-DbqwHgSbB24stRdpOZKfCBEV6gqlWKo
scenes-other-account-connected--github-login-linked--dark:
- hash: v1.k794b7964.cb6cb43c19b0a452a4e8bfc7050e387a37a0275aad18998181cfa73bfb70e4ca.DPwXEobXJpyYz6mYddoEOOOKtKVYPqH9X207YVmxAzI
+ hash: v1.k794b7964.c28913b3c0cb4f43c86fe7a8b0150d22f1f37e25b0f9405147361901dcf4a31e.CI2eQvwvybh1ZwXdPu8XUW4GRC66lD_2wIwotcJVax4
scenes-other-account-connected--github-login-linked--light:
- hash: v1.k794b7964.85bc50dd0699e2a59aeb36b406bbc5b2b2269a317078eac34614ca1a7772e039.g5EJd17LPECqG5oDib2iBYu7x7FzT_qd0cIHH7dTsoE
+ hash: v1.k794b7964.80060bb51825ee0444259a08963f62c8a2740ae303198b76e61736a48f7bc752.N-QcvjRocWdllivJ4aPMA75XKKHJR1dkijr9jTnZmJQ
scenes-other-account-connected--invalid-link--dark:
- hash: v1.k794b7964.701369c8815572e230847194697a10af64fbe3238b5ec2b97fb1ca472e921cb4.04vlOGhscYZQvQ0MZeCyfvHFER2HIhLpiFcH7AmsHrg
+ hash: v1.k794b7964.75a9d4278103c86ea0a0b55b3b6a46e7c88167c64c20f78d7a02f45814e89ab3.gyCAlFZt5fK0fz_c02_2lfdQvrSc3nMnRrCVNJwOLXQ
scenes-other-account-connected--invalid-link--light:
- hash: v1.k794b7964.a339eb77db0b616ec64e77e675da285d292381ded8eb0daa201eb575dffa8e26.RETEKLpQHdGlg32dKsJCmtN5amqXJKpNRGo8i4c7RZU
+ hash: v1.k794b7964.1fa4146d42b25365e805afb649fbd047265afe79563e6fc936af9e1f186624ce.tv8n5OGQNDqYP8oBB2FQZx0nyh2yl2ee8afO-Z2QKUs
scenes-other-authenticatedshellfallback--stuck-shell--dark:
hash: v1.k794b7964.701361424acc0289fd034abc12c8207144f480e0bdd22c0359465d4e7e51c7f0.qntozIS4u0U1agy-cU_rVXwzkp8CxJdr1wIPErK3gts
scenes-other-authenticatedshellfallback--stuck-shell--light:
@@ -16369,13 +16369,13 @@ snapshots:
scenes-other-billing-product--billing-product-without-addons--light:
hash: v1.k794b7964.1fe58bea4905f6ae9b86f4a04cd31afe7696f9ad14dd09c8063cd8278866ee62.w_4wpfkxEMM9cvslGt2KP3O6hegMMlQZmnnN3eGDdnU
scenes-other-credential-review--all-credential-types--dark:
- hash: v1.k794b7964.3c8a9e09b7a869d8223e10ee21cc51094d70f29dbd9187dfce8fff72588f59a8.efASQ5KXuzB_uaz9IObpuCiwN2TJnQUu_YMkeku5tU4
+ hash: v1.k794b7964.8aba38e38c580b087eb24814f601090171bc8031609db5184aa460ed6efc4f28.CJc-HSGQTFvKTSQL7wG-9OymU2CFYEMxkKEhmx_ZxDk
scenes-other-credential-review--all-credential-types--light:
- hash: v1.k794b7964.766a23a47420ba6a708f5084f995dd6ac25a828915284182eba4e88b796393f1.lo1HVZ3WIArWMjw3rTKtjuML0uaSnHGF9b_1hr3UKC0
+ hash: v1.k794b7964.02191da7bbba281b3e795f20d1e7ffe2efe7640643c42d794c43d341f5b84a8c.1DcRyw-hmHCIGAtaqSEXoWD6hN7sgeH8hCZUjb3a_L8
scenes-other-credential-review--only-a-connected-application--dark:
- hash: v1.k794b7964.3c8a9e09b7a869d8223e10ee21cc51094d70f29dbd9187dfce8fff72588f59a8.Lt0ziuFoVZUtXSlAbaynuoIS5zXugmTX-cVCR2YMr14
+ hash: v1.k794b7964.1022879e54205f7871a046667158845e3e9e3f125f1a5d50db87d79d83514457.3M5lK0-WKeQRIp_Yf5iJOQMfEfhgulFZZ_qZI97vFn4
scenes-other-credential-review--only-a-connected-application--light:
- hash: v1.k794b7964.766a23a47420ba6a708f5084f995dd6ac25a828915284182eba4e88b796393f1.tO-SEmx51HDseDPdpQoniCXLAzjt7QNeXqfUAAuXVro
+ hash: v1.k794b7964.2e955dc2aa3981f11ab332cbfe8f4bff04e31dec0974f8188d3e5c95372c5ab9.Tlg-j4TmLhfb8i2bRR1A7kP5SotUiTi54t78kAL3uUk
scenes-other-integration-landing-page--connect-rejected--dark:
hash: v1.k794b7964.744ffc04fe74e99127eee73f8a1c395fe7c56d89447b71465a1797a1ef05b832.2I1sdaQ3oUvbNcUNwdAbHmTjccZ9vnAAUiV5loBZnEo
scenes-other-integration-landing-page--connect-rejected--light:
@@ -16677,37 +16677,37 @@ snapshots:
scenes-other-organization-pending-deletion--pending-deletion--light:
hash: v1.k794b7964.b4d3bd0691c3b878ef1fa5a6404b79206e9de433cb52aaf2765246fea64da6c5.rllVi0no6y64yflVpXVCGrC7HibRFl84s-LXEOp4Zi0
scenes-other-password-reset--initial--dark:
- hash: v1.k794b7964.e3d5f708ff09306e1f06f485f1e389207698e60a0388f606900b947ca5a70ec9.3XJguWf4w1HF8NIOqLCRARBInuoUXmbo9esa81izrrM
+ hash: v1.k794b7964.099803f8fff4ce040f97272ef1528bf104097296bce22a5d959ad0d09178ac37.cgXf_qgBnyQTUDqJYB53tLbiqV-2C3nrbyjMb7T_WVE
scenes-other-password-reset--initial--light:
- hash: v1.k794b7964.316dc276adb3edd03f874f144d02270986e9158f219139752ec8c5f4cc734457.zbqG7wcSAbDYsusBII23dUi_UzToO8V-qKGU__RX07k
+ hash: v1.k794b7964.36b8306d687194426a14760dfea1259f1b39189c43ee7585cecbdb775c782876.EAgD-lVXTfI_IV96FTkyyd21Ay6iKchgXLr4ip0RAdk
scenes-other-password-reset--no-smtp--dark:
- hash: v1.k794b7964.83f4dbc01dee5226ba193f822090685c0961a2e4008c707ed44b055d383edc72.tOdR7ofSuG-DD-8Evmt8-qbEi9BQL2JBngIiMZNiOHg
+ hash: v1.k794b7964.2661dc041df4e7164ef8a772ab7753f226200d2c01c5c69ff19b758c1d545f3a.-IQcm90xY-cnnXrXbzhyB2aqAKaweQP_6HYWr7fONeE
scenes-other-password-reset--no-smtp--light:
- hash: v1.k794b7964.ba277f60cec36453b72be50920bb2358999004fdcc003d9c17a43b0b4a2f5a57.y1x8jOz2sSXkQHSoJcrYffYHNctxUCCWHRHP6WYWhXw
+ hash: v1.k794b7964.8580069b980ac84cb422e547a33b40e67298c43fcaf506e463a92091372ac614.CB1GjVAtmxg9JoiJhNw_hem-T0LPgZSDDcmdDk-hmLs
scenes-other-password-reset--success--dark:
- hash: v1.k794b7964.aa56533e64346ee42adfd1f6be0aa577adda384d1a31b73061de3c46a857c136.PiJNbGGvuYpy6IxvnT3FZLBq8UUIKVAHHS-JRBIk5eU
+ hash: v1.k794b7964.c7971708827489bc6c71450cf59d3cac7418280b77d25cb69c39a70cacb60434.0hIh_7h9MImHi-cqsnr5S1wKt4lA3MxnMDOrVQS59eE
scenes-other-password-reset--success--light:
- hash: v1.k794b7964.c5fd2b48e0e7067e45a76c1e7b999563176e3da6d4298c9655e71b3f9de04942.gkdnH2PrNA5_K5D6eKum3RdCrrScaQHYQYhdf76bie0
+ hash: v1.k794b7964.ae7e15caefc1985d40dab29172e9f7e8db3cc507ab34961ba8b1fb65a2114da7.kc7wG60zQXPuzMa2pP7hzyXLRgawbaQFRGu3Ktwr5lU
scenes-other-password-reset--throttled--dark:
- hash: v1.k794b7964.85dc0b8f21deae3386b4a0d55fa16184adb8f2aadb57f48bc78843d73868df0c.Iv5EFF0YH-r3eVBpryDG3UhdyXa1wanjHxAtpYrqmjY
+ hash: v1.k794b7964.09cccb987eb67191e421629957beb4878da6b2111c42fac41ef0ee63d250f490.YAh7nzOdjVHH_bPwxuqoEZQzaF0MHy4Z4m37wnvsJmE
scenes-other-password-reset--throttled--light:
- hash: v1.k794b7964.b1245400bb67a99dd1a1a39cbe3d69cb68edb843062c05b2e471ee0c8e87ca41.r-P_gfedoi3qn13NJbn-AgHrpCiXkpjax2xZu1jUSUA
+ hash: v1.k794b7964.fb055b5562479b6b51413c7076d41a3035615fdee3e5583b7a1eaa4b12485f93.gyWBL4F6ha7XJdCCCMbL2QAWkTluftI4TpVYlT-rX5Y
scenes-other-password-reset--with-email-from-query--dark:
- hash: v1.k794b7964.546188e182ce11690b00cf8d844a7a4f8b8f384d66496904ff2a41cade0c87c4.n8yBrWBDeR6cY9JS1P7Ch6Mc04EOpAA7EzIvtLKBGKI
+ hash: v1.k794b7964.3a6e3176f2a7719e620535ccad6be4706d3627b376d6fe4c95d96ef1691e320f.klmCwNpQwltTaPk3YowRzMOI5Mi5A_HsKfGDJHKrdWA
scenes-other-password-reset--with-email-from-query--light:
- hash: v1.k794b7964.9a7ae7a8bdbb3155e298d86d35058ea8745612b76a4a77e4c5f0eb4aca9acadd.OuoPlM7zdEQDr47EcxZGzcSUVK0lp5A0EfVwDwyibmg
+ hash: v1.k794b7964.0a747f87630801269f8b9e0a0ef31b695e5326ab8ed1a84e51c15197c15bd882.t1gc36UCnQ0H33fDwYuC4jnzWU7qc9ktOQc5-9mlpLI
scenes-other-password-reset-complete--default--dark:
- hash: v1.k794b7964.82eaa9f05efd0fc5e5d0d21306303514b39932f5813305e609a4ac2e47e9475e.CYRwqrNnjDY7ZXf_imKbEkgWvbdCy1fPr6Uk-OG-XA8
+ hash: v1.k794b7964.f3d261c8f207b37d08ed0d739b8cd1f32f839ef5c0c3e0faad4a6ad540e5580e.8xDhgK95SPmTIVTe-ajOwzjXUVoJwdyZ3a-Ezfs_i4g
scenes-other-password-reset-complete--default--light:
- hash: v1.k794b7964.96c79c2e88872ea303f1a160ce16576771d92e13da007a1d3770287cac81c67f.1WIE2kD7zh1-H96-96ZHU8i3eQxKhkrTktUDPsW-ifc
+ hash: v1.k794b7964.e2837e38715b8501ba0861ebccd17e99757f8a92f96fd9f4f63dbb19dd726df8.YT3eunTWHARoCETnPt3OP2FgRWiZJcDXYZkdc0tjfXg
scenes-other-password-reset-complete--invalid-link--dark:
- hash: v1.k794b7964.8a10af6f9c87b655cf7762eb21cbaf78088be65b385ac188e2e803719c2a36bd.GA8U2bTqbWwwEAEjRqj-9pxkOemVf1_NjqEopwUizgM
+ hash: v1.k794b7964.155b3673977f6f62c0743e1f983cbaafd93e03139d3ff2c37e44aa09d0ef79ea.Z8_JJam_FvzyPqr5mz9rkDxhTjiCNM_5jy37KtqgKjg
scenes-other-password-reset-complete--invalid-link--light:
- hash: v1.k794b7964.dac4ea506df484776c48d4c5e45024c02587afa69bcd16d53eade1dc47b44008.-ottausSQmDEEOFpeTjyT2e_hNA20Q--OGjA8wxq28w
+ hash: v1.k794b7964.c3a9ea9bc52f42982b318e401b5b1b85d11254892278dafbb862a7f4271dbede.L5e3kTMMUVqaQqiiPgJI8rlQjjmfogNgIx__yGcg6tU
scenes-other-preflight--preflight--dark:
- hash: v1.k794b7964.5ec5e0f777850cccc05c98155cc993fcfb20159efdb1acefdd97f36e22a33b91._5hEVZWfgPlu4PNfNe2JiY-UelMShRCfyOih7OfWI2I
+ hash: v1.k794b7964.4625761af83d62dd6b49339114f02458bf59d6e7b9ca4b55b90b5a6e017d52f9.sal6Qn75dZSDxJxF3JwfgD1V0kfgNq_NK_R4keaLp0g
scenes-other-preflight--preflight--light:
- hash: v1.k794b7964.5a738d166878bfa3cb8957b35fd757d2e86fec131e7e9fb7a064d016a661055e.NZIpqKS5E2Xvju2H2N2POOgrNlSSno1RcCgFGPFN5nM
+ hash: v1.k794b7964.2b39bab9efb2294df5723385095499e1a9dee677b4159868b98695c7cfa70cd2.4EuSQhbd6WQ5pIVpBviGAYPswim3Xqmp8lnmeOywpfk
scenes-other-settings-organization-ai-consent-legal-dialog--default--dark:
hash: v1.k794b7964.12315e5fde1bb2e7814a15f7a9cc0198c612686b866eba36ed6cd77574e7dd27.3vMXkezBP1ME7tvnVeAUI71RW8xhMitxG8y99mL3MJE
scenes-other-settings-organization-ai-consent-legal-dialog--default--light:
@@ -16857,9 +16857,9 @@ snapshots:
scenes-other-toolbarlaunch--no-urls-template--light:
hash: v1.k794b7964.382affdb4a2da5da05b98d2157cb42f23c6d898d92a1ba5a5ab434ad651f64fd.kGm3rT8KT_LA0U0umItCRcQfBXpE0xu28xXxKzbw29k
scenes-other-unsubscribe--unsubscribe-scene--dark:
- hash: v1.k794b7964.e75d32ee685dc6ca84cabbcdee6f0a8b6e676e098ec0970c3f40238eb63d2505.POz79bVIYS0jPbfMdP-EyhgiPeNDn9PIH2L_V-hvkLM
+ hash: v1.k794b7964.edf72647d38238fcbf4971f0650ce2714dcaf8cc74de13cffe66da88dcd5cf2f.db7vGipUsWVyRVTdF0VJc6x1L6ChKabAu6PPxBTv4FM
scenes-other-unsubscribe--unsubscribe-scene--light:
- hash: v1.k794b7964.32a495f27332766c8518281776aefd55f9735198498e2085607c5e31d485ee6c.2Nq1SK6bbI-ldCdtItLnJiYz0e5xrwvcDk_O7L7G9xQ
+ hash: v1.k794b7964.82f1ae1ed5fea7f4f236b1dc88247af7176b8c0b5cfdf96987a291ecb07a0f13.4V5Ihd7LFYoT_lLaUh3XtWJ_olrK_AW5C6EeDu3hNqY
scenes-other-welcome-dialog--default--dark:
hash: v1.k794b7964.78805404c7984295f1b22a3434b629f234052e61b824079c2d3dc20a405a29b2.8Lra1rJtS38B89clX5En0KuShHaXR62OYOOH9VMkbpw
scenes-other-welcome-dialog--default--light:
diff --git a/frontend/src/exporter/ExporterLogin.scss b/frontend/src/exporter/ExporterLogin.scss
deleted file mode 100644
index 08aff3559fbc..000000000000
--- a/frontend/src/exporter/ExporterLogin.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-.PasswordWrapper {
- max-height: 1000px;
- overflow: hidden;
- transition: max-height 0.8s ease-in-out;
-
- &.zero-height {
- max-height: 0;
- margin: 0 !important;
- }
-}
-
-.PasswordWrapper .LemonInput__input::placeholder {
- opacity: 0.5;
-}
diff --git a/frontend/src/exporter/ExporterLogin.tsx b/frontend/src/exporter/ExporterLogin.tsx
index ca4409394be7..c5b21428ccdc 100644
--- a/frontend/src/exporter/ExporterLogin.tsx
+++ b/frontend/src/exporter/ExporterLogin.tsx
@@ -1,15 +1,14 @@
-import './ExporterLogin.scss'
-
-import clsx from 'clsx'
import { MakeLogicType, actions, kea, path, reducers, useValues } from 'kea'
import { Form, forms } from 'kea-forms'
import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonInput } from 'lib/lemon-ui/LemonInput'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { ERROR_MESSAGES } from 'scenes/authentication/shared/loginErrorMessages'
import { SupportModalButton } from 'scenes/authentication/shared/SupportModalButton'
@@ -151,68 +150,45 @@ export interface ExporterLoginProps {
export function ExporterLogin(props: ExporterLoginProps): JSX.Element {
const { isLoginSubmitting, generalError, isSuccess } = useValues(loginLogic())
- const login = (
- <div className="space-y-4">
- <h2>Access share</h2>
- {generalError && (
- <LemonBanner type="error">
- {generalError.detail || ERROR_MESSAGES[generalError.code] || (
- <>
- Could not unlock the content.
- <br />
- Please try again.
- </>
- )}
- </LemonBanner>
- )}
- <Form logic={loginLogic} formKey="login" enableFormOnSubmit className="space-y-4">
- <div className={clsx('PasswordWrapper')}>
- <LemonField
- name="password"
- label={
- <div className="flex flex-1 items-center justify-between gap-2">
- <span>Password</span>
- </div>
- }
- >
+ return (
+ // A white-labelled share shows no PostHog branding, so it drops the corner notes and the logo
+ <AuthScene notes={props.whitelabel ? [] : AUTH_NOTES.exporter.default}>
+ <AuthSceneCard top={props.whitelabel ? null : undefined} footer={<SupportModalButton />}>
+ <AuthCardTitle
+ title="Access share"
+ sub="Don't have a password? Ask the person who shared this with you."
+ />
+ {generalError && (
+ <AuthBanner variant="danger" className="mb-4">
+ {generalError.detail ||
+ ERROR_MESSAGES[generalError.code] ||
+ 'Could not unlock the content. Please try again.'}
+ </AuthBanner>
+ )}
+ <Form logic={loginLogic} formKey="login" enableFormOnSubmit className="flex flex-col gap-4">
+ <LemonField name="password" label="Password">
<LemonInput
type="password"
className="ph-ignore-input"
data-attr="password"
placeholder="••••••••••"
autoComplete="current-password"
+ fullWidth
/>
</LemonField>
- </div>
-
- <LemonButton
- type="primary"
- status={isSuccess ? 'default' : 'alt'}
- htmlType="submit"
- data-attr="password-login"
- fullWidth
- center
- loading={isLoginSubmitting && !isSuccess}
- size="large"
- >
- {isSuccess ? 'Access granted!' : 'Unlock'}
- </LemonButton>
- </Form>
- <div className="text-center mt-4">Don't have a password? Ask the person who shared this with you!</div>
- </div>
- )
-
- if (props.whitelabel) {
- return (
- <BridgePage noLogo view="login" footer={<SupportModalButton />}>
- {login}
- </BridgePage>
- )
- }
-
- return (
- <BridgePage view="login" footer={<SupportModalButton />}>
- {login}
- </BridgePage>
+ <LemonButton
+ type="primary"
+ htmlType="submit"
+ data-attr="password-login"
+ fullWidth
+ center
+ loading={isLoginSubmitting && !isSuccess}
+ size="large"
+ >
+ {isSuccess ? 'Access granted!' : 'Unlock'}
+ </LemonButton>
+ </Form>
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/layout/navigation-3000/Navigation.scss b/frontend/src/layout/navigation-3000/Navigation.scss
index 6ea1c2499a78..a6062528b8b1 100644
--- a/frontend/src/layout/navigation-3000/Navigation.scss
+++ b/frontend/src/layout/navigation-3000/Navigation.scss
@@ -59,12 +59,6 @@
min-width: 0;
overflow: hidden auto;
}
-
- .BridgePage {
- height: 100%;
- overflow: visible;
- background: none;
- }
}
// If flag is enabled, we use the scene header height for the breadcrumbs height
diff --git a/frontend/src/lib/components/BridgePage/BridgePage.scss b/frontend/src/lib/components/BridgePage/BridgePage.scss
deleted file mode 100644
index 825c81246462..000000000000
--- a/frontend/src/lib/components/BridgePage/BridgePage.scss
+++ /dev/null
@@ -1,111 +0,0 @@
-@import '../../../styles/mixins';
-@import '../../../styles/vars';
-
-.BridgePage {
- position: relative;
- display: flex;
- flex: 1;
- flex-direction: column;
- height: 100vh;
- overflow: auto;
- background-color: var(--color-bg-bridge);
- -ms-overflow-style: none;
-
- &::-webkit-scrollbar {
- width: 0 !important;
- }
-
- .BridgePage__main {
- display: flex;
- flex: 1;
- align-items: center;
- justify-content: center;
- padding: 1rem;
- }
-
- .BridgePage__content-wrapper {
- width: 100%;
- max-width: 390px;
-
- @include screen($md) {
- width: auto;
- max-width: 100%;
- }
- }
-
- .BridgePage__left-wrapper {
- display: none;
- margin-right: 60px;
-
- @include screen($md) {
- display: block;
- visibility: visible;
- }
- }
-
- .BridgePage__content {
- position: relative;
- width: 100%;
- padding: 1.25rem;
- background-color: var(--color-bg-surface-primary);
- border-radius: var(--radius);
- box-shadow: var(--shadow-elevation-3000);
-
- h2 {
- font-weight: bold;
- text-align: center;
- }
-
- @include screen($md) {
- padding: 2rem;
- }
- }
-
- .BridgePage__footer {
- display: flex;
- gap: 10%;
- justify-content: center;
- width: 100%;
- margin: 1rem 0;
- font-weight: 500;
- color: var(--color-text-secondary);
- }
-
- .BridgePage__left {
- position: relative;
- display: none;
- visibility: none;
-
- img {
- height: 300px;
- }
-
- @include screen($md) {
- display: block;
- visibility: visible;
- }
- }
-
- .BridgePage__cta {
- max-width: 400px;
- }
-
- .BridgePage__header-logo {
- &.mobile {
- display: block;
-
- @include screen($md) {
- display: none;
- }
- }
- }
-
- &.BridgePage--fixed-width {
- @include screen($md) {
- .BridgePage__content {
- width: 400px;
- max-width: 400px;
- }
- }
- }
-}
diff --git a/frontend/src/lib/components/BridgePage/BridgePage.tsx b/frontend/src/lib/components/BridgePage/BridgePage.tsx
deleted file mode 100644
index 5d473451bd21..000000000000
--- a/frontend/src/lib/components/BridgePage/BridgePage.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import './BridgePage.scss'
-
-import clsx from 'clsx'
-
-import { WelcomeLogo } from 'scenes/authentication/shared/WelcomeLogo'
-
-export type BridgePageProps = {
- children?: React.ReactNode
- footer?: React.ReactNode
- header?: React.ReactNode
- view: string
- noLogo?: boolean
- sideLogo?: boolean
- fixedWidth?: boolean
- leftContainerContent?: JSX.Element
- style?: React.CSSProperties
-}
-
-export function BridgePage({
- children,
- header,
- footer,
- view,
- noLogo = false,
- sideLogo = false,
- fixedWidth = true,
- leftContainerContent,
- style,
-}: BridgePageProps): JSX.Element {
- return (
- <div className={clsx('BridgePage', fixedWidth && 'BridgePage--fixed-width')} style={style}>
- <div className="BridgePage__main">
- {leftContainerContent ? (
- <div className="BridgePage__left-wrapper">
- <div className="BridgePage__left">
- {!noLogo && sideLogo && (
- <div className="BridgePage__header-logo mb-16">
- <WelcomeLogo view={view} />
- </div>
- )}
- {leftContainerContent}
- </div>
- </div>
- ) : null}
- <div className="BridgePage__content-wrapper">
- {!noLogo && (
- <div className={clsx('BridgePage__header-logo', { mobile: sideLogo })}>
- <WelcomeLogo view={view} />
- </div>
- )}
- <div className="BridgePage__header">{header}</div>
- <div className="BridgePage__content">{children}</div>
- </div>
- </div>
- {footer && <div className="BridgePage__footer">{footer}</div>}
- </div>
- )
-}
diff --git a/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx b/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx
index 2488f145e15a..543361cef141 100644
--- a/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx
+++ b/frontend/src/scenes/PreflightCheck/PreflightCheck.tsx
@@ -7,12 +7,13 @@ import { IconCheckCircle, IconCollapse, IconExpand, IconRefresh, IconWarning } f
import { Link, Spinner } from '@posthog/lemon-ui'
import { AnimatedCollapsible } from 'lib/components/AnimatedCollapsible'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import { IconErrorOutline } from 'lib/lemon-ui/icons'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonDivider } from 'lib/lemon-ui/LemonDivider'
import { LemonRow } from 'lib/lemon-ui/LemonRow'
import { capitalizeFirstLetter } from 'lib/utils/strings'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { PreflightCheckStatus, PreflightItem, preflightLogic } from './preflightLogic'
@@ -65,159 +66,172 @@ export function PreflightCheck(): JSX.Element {
const { setPreflightMode, handlePreflightFinished, setChecksManuallyExpanded, revalidatePreflight } =
useActions(preflightLogic)
- return (
- <BridgePage
- view="preflight-check"
- footer={
- <p className="text-center mt-4 mb-0">
- Need help? Take a look at our{' '}
- <Link
- to="https://posthog.com/docs/self-host/deploy/troubleshooting"
- target="_blank"
- targetBlankIcon={false}
- >
- documentation
- </Link>{' '}
- or{' '}
- <Link to="https://posthog.com/support" target="_blank" targetBlankIcon={false}>
- visit community support
- </Link>
- .
- </p>
- }
- fixedWidth={false}
- >
- <div className="Preflight">
- {!preflightMode ? (
- <>
- <div className="Preflight__header">
- <p className="Preflight__header--title-text">Select a launch mode</p>
- <p className="Preflight__header--secondary-text">
- What's your plan for this installation? We'll make infrastructure checks accordingly.
- </p>
- </div>
- <LemonButton
- fullWidth
- center
- type="primary"
- className="mt-2"
- size="large"
- data-attr="preflight-live"
- onClick={() => setPreflightMode('live')}
- >
- Live implementation
- </LemonButton>
- <LemonButton
- type="secondary"
- fullWidth
- center
- className="mt-2"
- size="large"
- data-attr="preflight-experimentation"
- onClick={() => setPreflightMode('experimentation')}
- >
- Just experimenting
- </LemonButton>
- <LemonDivider thick dashed className="my-6" />
- <p className="text-secondary text-center mb-0">
- We will not enforce some security requirements in experimentation mode.
- </p>
- </>
- ) : (
- <>
- <div className="Preflight__header">
- <p className="Preflight__header--title-text">Validate implementation</p>
- <p className="Preflight__header--secondary-text">
- Validation happens immediately. You can rerun validation checks by clicking “validate
- requirements”. If you get stuck, try our{' '}
- <Link to="https://posthog.com/docs/self-host/deploy/troubleshooting" target="_blank">
- troubleshooting guide
- </Link>{' '}
- or our{' '}
- <Link to="https://posthog.com/docs/runbook" target="_blank">
- self-host runbook
- </Link>
- .
- </p>
- </div>
+ const footer = (
+ <p className="mt-5 mb-0 text-sm text-secondary text-center">
+ <span>Need help? Take a look at our</span>{' '}
+ <Link
+ to="https://posthog.com/docs/self-host/deploy/troubleshooting"
+ target="_blank"
+ targetBlankIcon={false}
+ className="font-semibold no-underline cursor-pointer hover:underline hover:underline-offset-2 text-warning"
+ >
+ documentation
+ </Link>{' '}
+ <span>or</span>{' '}
+ <Link
+ to="https://posthog.com/support"
+ target="_blank"
+ targetBlankIcon={false}
+ className="font-semibold no-underline cursor-pointer hover:underline hover:underline-offset-2 text-warning"
+ >
+ visit community support
+ </Link>
+ <span>.</span>
+ </p>
+ )
- <div className="Preflight__checks-container">
- <div className="Preflight__check-summary">
- <div
- className={clsx(
- 'Preflight__summary-icon-container',
- preflightLoading
- ? 'Preflight--loading'
- : `Preflight--${checksSummary.summaryStatus}`
- )}
- >
- <PreflightCheckIcon
- status={checksSummary.summaryStatus}
- loading={preflightLoading}
- />
- </div>
- <div className="Preflight__summary-text-container">
- <p className="Preflight__summary-header">Validation checks</p>
- <p data-attr="caption" className="text-secondary Preflight__summary-description">
- {checksSummary.summaryString}
- </p>
- </div>
- <LemonButton
- icon={
- areChecksExpanded ? (
- <IconCollapse style={{ color: 'var(--color-text-secondary)' }} />
- ) : (
- <IconExpand style={{ color: 'var(--color-text-secondary)' }} />
- )
- }
- onClick={() => {
- setChecksManuallyExpanded(!areChecksExpanded)
- }}
- />
+ return (
+ <AuthScene notes={AUTH_NOTES.preflight.default}>
+ <AuthSceneCard footer={footer}>
+ <div className="Preflight">
+ {!preflightMode ? (
+ <>
+ <div className="Preflight__header">
+ <p className="Preflight__header--title-text">Select a launch mode</p>
+ <p className="Preflight__header--secondary-text">
+ What's your plan for this installation? We'll make infrastructure checks
+ accordingly.
+ </p>
</div>
- <AnimatedCollapsible collapsed={!areChecksExpanded}>
- <>
- {checks.map((item) => (
- <PreflightItemRow key={item.id} {...item} />
- ))}
- </>
- </AnimatedCollapsible>
<LemonButton
- center
fullWidth
+ center
+ type="primary"
+ className="mt-2"
size="large"
- data-attr="preflight-refresh"
- onClick={() => revalidatePreflight()}
- disabled={preflightLoading || !preflight}
- icon={<IconRefresh />}
+ data-attr="preflight-live"
+ onClick={() => setPreflightMode('live')}
>
- Validate requirements
+ Live implementation
</LemonButton>
- </div>
- <LemonDivider thick dashed className="my-6" />
- {checksSummary.summaryStatus !== 'error' || preflightMode == 'experimentation' ? (
<LemonButton
+ type="secondary"
fullWidth
center
- type="primary"
className="mt-2"
size="large"
- data-attr="preflight-complete"
- onClick={handlePreflightFinished}
+ data-attr="preflight-experimentation"
+ onClick={() => setPreflightMode('experimentation')}
>
- Continue
+ Just experimenting
</LemonButton>
- ) : (
- <LemonRow fullWidth center className="mt-2 Preflight__cannot-continue" size="large">
- <p className="text-center text-secondary">
- All required checks must pass before you can continue
+ <LemonDivider thick dashed className="my-6" />
+ <p className="text-secondary text-center mb-0">
+ We will not enforce some security requirements in experimentation mode.
+ </p>
+ </>
+ ) : (
+ <>
+ <div className="Preflight__header">
+ <p className="Preflight__header--title-text">Validate implementation</p>
+ <p className="Preflight__header--secondary-text">
+ Validation happens immediately. You can rerun validation checks by clicking
+ “validate requirements”. If you get stuck, try our{' '}
+ <Link
+ to="https://posthog.com/docs/self-host/deploy/troubleshooting"
+ target="_blank"
+ >
+ troubleshooting guide
+ </Link>{' '}
+ or our{' '}
+ <Link to="https://posthog.com/docs/runbook" target="_blank">
+ self-host runbook
+ </Link>
+ .
</p>
- </LemonRow>
- )}
- </>
- )}
- </div>
- </BridgePage>
+ </div>
+
+ <div className="Preflight__checks-container">
+ <div className="Preflight__check-summary">
+ <div
+ className={clsx(
+ 'Preflight__summary-icon-container',
+ preflightLoading
+ ? 'Preflight--loading'
+ : `Preflight--${checksSummary.summaryStatus}`
+ )}
+ >
+ <PreflightCheckIcon
+ status={checksSummary.summaryStatus}
+ loading={preflightLoading}
+ />
+ </div>
+ <div className="Preflight__summary-text-container">
+ <p className="Preflight__summary-header">Validation checks</p>
+ <p
+ data-attr="caption"
+ className="text-secondary Preflight__summary-description"
+ >
+ {checksSummary.summaryString}
+ </p>
+ </div>
+ <LemonButton
+ icon={
+ areChecksExpanded ? (
+ <IconCollapse style={{ color: 'var(--color-text-secondary)' }} />
+ ) : (
+ <IconExpand style={{ color: 'var(--color-text-secondary)' }} />
+ )
+ }
+ onClick={() => {
+ setChecksManuallyExpanded(!areChecksExpanded)
+ }}
+ />
+ </div>
+ <AnimatedCollapsible collapsed={!areChecksExpanded}>
+ <>
+ {checks.map((item) => (
+ <PreflightItemRow key={item.id} {...item} />
+ ))}
+ </>
+ </AnimatedCollapsible>
+ <LemonButton
+ center
+ fullWidth
+ size="large"
+ data-attr="preflight-refresh"
+ onClick={() => revalidatePreflight()}
+ disabled={preflightLoading || !preflight}
+ icon={<IconRefresh />}
+ >
+ Validate requirements
+ </LemonButton>
+ </div>
+ <LemonDivider thick dashed className="my-6" />
+ {checksSummary.summaryStatus !== 'error' || preflightMode == 'experimentation' ? (
+ <LemonButton
+ fullWidth
+ center
+ type="primary"
+ className="mt-2"
+ size="large"
+ data-attr="preflight-complete"
+ onClick={handlePreflightFinished}
+ >
+ Continue
+ </LemonButton>
+ ) : (
+ <LemonRow fullWidth center className="mt-2 Preflight__cannot-continue" size="large">
+ <p className="text-center text-secondary">
+ All required checks must pass before you can continue
+ </p>
+ </LemonRow>
+ )}
+ </>
+ )}
+ </div>
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/Unsubscribe/Unsubscribe.tsx b/frontend/src/scenes/Unsubscribe/Unsubscribe.tsx
index fce56e7ba8fa..49b2c4eac388 100644
--- a/frontend/src/scenes/Unsubscribe/Unsubscribe.tsx
+++ b/frontend/src/scenes/Unsubscribe/Unsubscribe.tsx
@@ -1,7 +1,9 @@
import { useValues } from 'kea'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import { SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner'
+import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { unsubscribeLogic } from './unsubscribeLogic'
@@ -13,22 +15,34 @@ export const scene: SceneExport = {
export function Unsubscribe(): JSX.Element {
const { unsubscriptionLoading, unsubscription } = useValues(unsubscribeLogic)
+ const notes = unsubscriptionLoading
+ ? AUTH_NOTES.unsubscribe.loading
+ : unsubscription
+ ? AUTH_NOTES.unsubscribe.done
+ : AUTH_NOTES.unsubscribe.failed
+
return (
- <BridgePage view="unsubscribe">
- {unsubscriptionLoading ? (
- <SpinnerOverlay sceneLevel />
- ) : unsubscription ? (
- <div>
- <h2>You have been unsubscribed!</h2>
- <p>You will no longer receive these kinds of emails.</p>
- </div>
- ) : (
- <div>
- <h2>Something went wrong!</h2>
- <p>Your may already be unsubscribed or the link you clicked may be invalid.</p>
- </div>
- )}
- </BridgePage>
+ <AuthScene notes={notes}>
+ <AuthSceneCard>
+ {unsubscriptionLoading ? (
+ <div className="flex justify-center">
+ <Spinner className="text-2xl" />
+ </div>
+ ) : unsubscription ? (
+ <AuthCardTitle
+ className="mb-0"
+ title="You have been unsubscribed!"
+ sub="You will no longer receive these kinds of emails."
+ />
+ ) : (
+ <AuthCardTitle
+ className="mb-0"
+ title="Something went wrong!"
+ sub="You may already be unsubscribed or the link you clicked may be invalid."
+ />
+ )}
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/authentication/account/AccountConnected.tsx b/frontend/src/scenes/authentication/account/AccountConnected.tsx
index fd38fdb18ffa..d8cdb5c27d46 100644
--- a/frontend/src/scenes/authentication/account/AccountConnected.tsx
+++ b/frontend/src/scenes/authentication/account/AccountConnected.tsx
@@ -1,16 +1,19 @@
import { useValues } from 'kea'
import { router } from 'kea-router'
-import { useEffect } from 'react'
+import { type ReactNode, useEffect } from 'react'
import { IconCheckCircle, IconHourglass, IconWarning } from '@posthog/icons'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import { SSO_PROVIDER_NAMES } from 'lib/constants'
import {
GITHUB_INSTALL_PENDING_MESSAGE,
describeGithubSetupError,
getGithubSetupErrorCode,
} from 'lib/integrations/githubSetupErrors'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES, type AuthNotes } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import type { SSOProvider } from '~/types'
@@ -142,53 +145,83 @@ export function AccountConnected({ kind }: AccountConnectedProps): JSX.Element {
if (!hasValidKind) {
return (
- <BridgePage view="account-connected">
- <div className="flex flex-col items-center gap-4 text-center max-w-lg mx-auto">
- <p className="text-muted mb-0">
- This link is not valid. Return to PostHog from the product you started from.
- </p>
- </div>
- </BridgePage>
+ <AccountConnectedCard
+ title="This link is not valid"
+ notes={AUTH_NOTES.accountConnected.invalid}
+ sub="Return to PostHog from the product you started from."
+ />
)
}
const showLoginLine = kind === 'github-login' && !isError
return (
- <BridgePage view="account-connected">
- <div className="flex flex-col items-center gap-4 text-center max-w-lg mx-auto">
- {startedFromChat && isPending ? (
- <IconHourglass className="text-warning text-5xl shrink-0" />
+ <AccountConnectedCard
+ icon={
+ startedFromChat && isPending ? (
+ // The auth scene maps `text-warning` to the primary text color, so read `--warning` directly
+ <IconHourglass className="text-[var(--warning)] text-5xl" />
) : isError ? (
- <IconWarning className="text-danger text-5xl shrink-0" />
- ) : (
- <IconCheckCircle className="text-success text-5xl shrink-0" />
- )}
- <h2 className="text-xl font-semibold m-0">
- {startedFromChat && isPending ? `${label} install needs approval` : headline(kind, label, isError)}
- </h2>
- {showLoginLine && <p className="text-muted mb-0">You can now log into PostHog using {label}.</p>}
- {startedFromChat ? (
- <p className="text-muted mb-0">
- {chatReturnMessage(
- errorCode,
- typeof searchParams.error_message === 'string' ? searchParams.error_message : null
- )}
- </p>
- ) : startedFromSlack ? (
- <p className="text-muted mb-0">
- {isError
- ? 'Something went wrong. Head back to Slack and try again.'
- : 'You can head back to Slack now.'}
- </p>
+ <IconWarning className="text-danger text-5xl" />
) : (
- <p className="text-muted mb-0">
- <strong>Returning to PostHog Desktop…</strong>
- <br />
- <em>If this hasn't happened automatically, get back to the PostHog Desktop app manually.</em>
+ <IconCheckCircle className="text-success text-5xl" />
+ )
+ }
+ title={startedFromChat && isPending ? `${label} install needs approval` : headline(kind, label, isError)}
+ sub={showLoginLine ? `You can now log into PostHog using ${label}.` : undefined}
+ notes={
+ startedFromChat && isPending
+ ? AUTH_NOTES.accountConnected.pending
+ : isError
+ ? AUTH_NOTES.accountConnected.failed
+ : AUTH_NOTES.accountConnected.connected
+ }
+ >
+ {startedFromChat ? (
+ <AuthBanner variant={isPending ? 'warning' : isError ? 'danger' : 'note'}>
+ {chatReturnMessage(
+ errorCode,
+ typeof searchParams.error_message === 'string' ? searchParams.error_message : null
+ )}
+ </AuthBanner>
+ ) : startedFromSlack ? (
+ <AuthBanner variant={isError ? 'danger' : 'note'}>
+ {isError
+ ? 'Something went wrong. Head back to Slack and try again.'
+ : 'You can head back to Slack now.'}
+ </AuthBanner>
+ ) : (
+ <AuthBanner variant="note">
+ <p className="m-0 font-semibold text-primary">Returning to PostHog Desktop…</p>
+ <p className="m-0">
+ If this hasn't happened automatically, get back to the PostHog Desktop app manually.
</p>
- )}
- </div>
- </BridgePage>
+ </AuthBanner>
+ )}
+ </AccountConnectedCard>
+ )
+}
+
+function AccountConnectedCard({
+ icon,
+ title,
+ sub,
+ notes,
+ children,
+}: {
+ icon?: ReactNode
+ title: string
+ sub?: string
+ notes: AuthNotes
+ children?: ReactNode
+}): JSX.Element {
+ return (
+ <AuthScene notes={notes}>
+ <AuthSceneCard>
+ {icon && <div className="flex justify-center mb-3">{icon}</div>}
+ <AuthCardTitle title={title} sub={sub} />
+ {children}
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/authentication/account/AgenticAccountMismatch.tsx b/frontend/src/scenes/authentication/account/AgenticAccountMismatch.tsx
index 61c6a1a9e9a4..754edfb4a6ed 100644
--- a/frontend/src/scenes/authentication/account/AgenticAccountMismatch.tsx
+++ b/frontend/src/scenes/authentication/account/AgenticAccountMismatch.tsx
@@ -3,8 +3,10 @@ import { router } from 'kea-router'
import { LemonButton } from '@posthog/lemon-ui'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import { IconErrorOutline } from 'lib/lemon-ui/icons'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { userLogic } from 'scenes/userLogic'
@@ -25,27 +27,38 @@ export function AgenticAccountMismatch(): JSX.Element {
const nextUrl = state ? `/api/agentic/authorize?state=${encodeURIComponent(state)}` : null
return (
- <BridgePage view="agentic-account-mismatch">
- <div className="text-center mb-4">
- <IconErrorOutline className="text-warning text-4xl" />
- </div>
- <h2 className="text-center">Account mismatch</h2>
- <div className="text-center mb-6">
- <p className="mb-2">
- You're currently logged in as <strong>{currentEmail}</strong>, but your {partnerName} account is
- linked to {expectedEmail ? <strong>{expectedEmail}</strong> : 'a different PostHog account'}.
- </p>
- <p>To continue, log out and sign in with the correct email.</p>
- </div>
- <div className="flex flex-col gap-2">
- <LemonButton fullWidth type="primary" center onClick={() => logout(false, nextUrl ?? undefined)}>
- {expectedEmail ? `Log out and continue as ${expectedEmail}` : 'Log out and continue'}
- </LemonButton>
- <LemonButton fullWidth type="secondary" center to="/">
- Cancel
- </LemonButton>
- </div>
- </BridgePage>
+ <AuthScene notes={AUTH_NOTES.accountMismatch.default}>
+ <AuthSceneCard>
+ <AuthCardTitle title="Account mismatch" sub="Let's get you into the right one." />
+ <div className="flex flex-col gap-3">
+ <AuthBanner variant="warning">
+ <p className="m-0 mb-1.5">
+ <span>You're currently logged in as</span> <strong>{currentEmail}</strong>
+ <span>{`, but your ${partnerName} account is linked to`}</span>{' '}
+ {expectedEmail ? (
+ <strong>{expectedEmail}</strong>
+ ) : (
+ <span>a different PostHog account</span>
+ )}
+ <span>.</span>
+ </p>
+ <p className="m-0">To continue, log out and sign in with the correct email.</p>
+ </AuthBanner>
+ <LemonButton
+ fullWidth
+ type="primary"
+ center
+ size="large"
+ onClick={() => logout(false, nextUrl ?? undefined)}
+ >
+ {expectedEmail ? `Log out and continue as ${expectedEmail}` : 'Log out and continue'}
+ </LemonButton>
+ <LemonButton fullWidth type="secondary" center size="large" to="/">
+ Cancel
+ </LemonButton>
+ </div>
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/authentication/account/credential-review/CredentialReview.tsx b/frontend/src/scenes/authentication/account/credential-review/CredentialReview.tsx
index f6c509a7d486..45ee6e0d811f 100644
--- a/frontend/src/scenes/authentication/account/credential-review/CredentialReview.tsx
+++ b/frontend/src/scenes/authentication/account/credential-review/CredentialReview.tsx
@@ -4,7 +4,9 @@ import * as heartPng from '@posthog/brand/hoggies/png/heart'
import { LemonButton } from '@posthog/lemon-ui'
import { pngHoggie } from 'lib/brand/hoggies'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { credentialReviewLogic } from './credentialReviewLogic'
@@ -22,23 +24,23 @@ export function CredentialReview(): JSX.Element {
const { continueDisabledReason, isCompleting } = useValues(credentialReviewLogic)
return (
- <BridgePage view="credential-review" fixedWidth={false}>
- <div className="px-12 py-8 flex flex-col items-center max-w-3xl w-full text-center">
- <h2 className="text-lg">Welcome to PostHog!</h2>
- <h1 className="text-3xl font-bold">One more thing.</h1>
- <div className="max-w-60 my-8">
+ <AuthScene notes={AUTH_NOTES.credentialReview.default} wide>
+ <AuthSceneCard>
+ <div className="max-w-40 mx-auto mb-4">
<HedgehogHeart className="w-full h-full" />
</div>
- <p className="mb-6 max-w-xl">
- Your account was set up with the credentials and connected apps listed below. Review them and revoke
- anything you don't recognize before continuing.
- </p>
- <div className="w-full mb-6 text-left">
+ <AuthCardTitle
+ title="One more thing"
+ sub="Your account was set up with the credentials and connected apps below. Review them and revoke anything you don't recognize before continuing."
+ />
+ <div className="mb-6 text-left">
<CredentialsReviewList />
</div>
<LemonButton
type="primary"
size="large"
+ fullWidth
+ center
onClick={() => markComplete()}
loading={isCompleting}
disabledReason={continueDisabledReason}
@@ -46,7 +48,7 @@ export function CredentialReview(): JSX.Element {
>
Continue to PostHog
</LemonButton>
- </div>
- </BridgePage>
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/authentication/auth/Auth.tsx b/frontend/src/scenes/authentication/auth/Auth.tsx
index 114073309fb0..a19d1cdb5268 100644
--- a/frontend/src/scenes/authentication/auth/Auth.tsx
+++ b/frontend/src/scenes/authentication/auth/Auth.tsx
@@ -1,6 +1,7 @@
import { useActions, useMountedLogic, useValues } from 'kea'
import { useEffect } from 'react'
+import { AUTH_NOTES, type AuthNotes } from 'scenes/authentication/shared/authScene/authNotes'
import { AuthScene } from 'scenes/authentication/shared/authScene/AuthScene'
import { AuthEntry } from 'scenes/authentication/shared/authStepViewed'
import { useLastLoginMethod } from 'scenes/authentication/shared/lastLoginMethod'
@@ -26,25 +27,21 @@ export const scene: SceneExport = {
logic: authLogic,
}
-const WELCOME_BACK_NOTES = ['// welcome back', '// 500,000+ teams ship here']
-const FIRST_VISIT_NOTES = ['// hey, good to see you', '// 500,000+ teams ship here']
-const CREATE_ACCOUNT_NOTES = ['// create an account', '// 1M events free, every month']
-
-function authNotes(step: AuthPageStep, entry: AuthEntry, isReturning: boolean): string[] {
+function authNotes(step: AuthPageStep, entry: AuthEntry, isReturning: boolean): AuthNotes {
switch (step) {
case 'login':
case 'login_code':
- return WELCOME_BACK_NOTES
+ return AUTH_NOTES.auth.welcomeBack
case 'signup_credentials':
case 'signup_pending_invite':
- return CREATE_ACCOUNT_NOTES
+ return AUTH_NOTES.auth.createAccount
case 'signup_profile':
- return ['// almost there', '// last step']
+ return AUTH_NOTES.auth.signupProfile
default:
if (entry === 'signup') {
- return CREATE_ACCOUNT_NOTES
+ return AUTH_NOTES.auth.createAccount
}
- return isReturning ? WELCOME_BACK_NOTES : FIRST_VISIT_NOTES
+ return isReturning ? AUTH_NOTES.auth.welcomeBack : AUTH_NOTES.auth.firstVisit
}
}
diff --git a/frontend/src/scenes/authentication/auth/components/OtherRegionNotice.tsx b/frontend/src/scenes/authentication/auth/components/OtherRegionNotice.tsx
index 4c5a6628ebd6..7e189fe6e254 100644
--- a/frontend/src/scenes/authentication/auth/components/OtherRegionNotice.tsx
+++ b/frontend/src/scenes/authentication/auth/components/OtherRegionNotice.tsx
@@ -4,7 +4,7 @@ import { useValues } from 'kea'
import { Link } from 'lib/lemon-ui/Link'
import { countryCodeToFlag } from 'lib/utils/country'
import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
-import { otherRegionLoginUrl, otherRegionOf } from 'scenes/authentication/shared/OtherRegionHint'
+import { otherRegionLoginUrl, otherRegionOf } from 'scenes/authentication/shared/otherRegion'
import { pendingOAuthConnectionLogic } from 'scenes/authentication/shared/pendingOAuthConnectionLogic'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
diff --git a/frontend/src/scenes/authentication/auth/steps/EmailStep.tsx b/frontend/src/scenes/authentication/auth/steps/EmailStep.tsx
index 92afb9522114..368dc321b29b 100644
--- a/frontend/src/scenes/authentication/auth/steps/EmailStep.tsx
+++ b/frontend/src/scenes/authentication/auth/steps/EmailStep.tsx
@@ -76,7 +76,7 @@ export function EmailStep(): JSX.Element {
}, [login.email, prevEmail, precheckResponse.status, precheck])
return (
- <AuthSceneCard>
+ <AuthSceneCard showPendingConnection>
<EmailStepTitle />
<SessionRiskBanner className="mb-4" />
<LoginErrorBanner />
diff --git a/frontend/src/scenes/authentication/auth/steps/LoginCodeStep.tsx b/frontend/src/scenes/authentication/auth/steps/LoginCodeStep.tsx
index 79dbb8b0e28b..81fff9eac140 100644
--- a/frontend/src/scenes/authentication/auth/steps/LoginCodeStep.tsx
+++ b/frontend/src/scenes/authentication/auth/steps/LoginCodeStep.tsx
@@ -29,7 +29,7 @@ export function LoginCodeStep(): JSX.Element {
} = useValues(loginLogic)
return (
- <AuthSceneCard>
+ <AuthSceneCard showPendingConnection>
<HedgehogMagnifyingGlass className="block w-auto mx-auto mb-3 h-28" />
<AuthCardTitle
className="mb-2"
diff --git a/frontend/src/scenes/authentication/auth/steps/LoginStep.tsx b/frontend/src/scenes/authentication/auth/steps/LoginStep.tsx
index e2f2638b4c22..0653bfd281c2 100644
--- a/frontend/src/scenes/authentication/auth/steps/LoginStep.tsx
+++ b/frontend/src/scenes/authentication/auth/steps/LoginStep.tsx
@@ -94,7 +94,7 @@ export function LoginStep(): JSX.Element {
const isPasswordHidden = !!precheckResponse.sso_enforcement || isPasswordLoginUnavailable || isNewAccount
return (
- <AuthSceneCard footer={<UseDifferentEmailLink />}>
+ <AuthSceneCard footer={<UseDifferentEmailLink />} showPendingConnection>
<LoginStepTitle />
<LoginErrorBanner />
{generalError?.code === 'invalid_credentials' && (
diff --git a/frontend/src/scenes/authentication/auth/steps/PendingInviteStep.tsx b/frontend/src/scenes/authentication/auth/steps/PendingInviteStep.tsx
index 2e007ff3791b..b5874ccdeed4 100644
--- a/frontend/src/scenes/authentication/auth/steps/PendingInviteStep.tsx
+++ b/frontend/src/scenes/authentication/auth/steps/PendingInviteStep.tsx
@@ -14,7 +14,7 @@ export function PendingInviteStep(): JSX.Element {
const org = pendingInvite?.organization_name ?? 'your team'
return (
- <AuthSceneCard footer={<UseDifferentEmailLink />}>
+ <AuthSceneCard footer={<UseDifferentEmailLink />} showPendingConnection>
<AuthCardTitle
title="You've already been invited"
sub={
diff --git a/frontend/src/scenes/authentication/auth/steps/SignupCredentialsStep.tsx b/frontend/src/scenes/authentication/auth/steps/SignupCredentialsStep.tsx
index 1ee2f7ec1ed5..f7810143c547 100644
--- a/frontend/src/scenes/authentication/auth/steps/SignupCredentialsStep.tsx
+++ b/frontend/src/scenes/authentication/auth/steps/SignupCredentialsStep.tsx
@@ -55,7 +55,7 @@ export function SignupCredentialsStep(): JSX.Element {
)
return (
- <AuthSceneCard footer={footer}>
+ <AuthSceneCard footer={footer} showPendingConnection>
<AuthCardTitle
title={
pendingConnection ? (
diff --git a/frontend/src/scenes/authentication/auth/steps/SignupProfileStep.tsx b/frontend/src/scenes/authentication/auth/steps/SignupProfileStep.tsx
index ff5874e39ad9..ce38cce64442 100644
--- a/frontend/src/scenes/authentication/auth/steps/SignupProfileStep.tsx
+++ b/frontend/src/scenes/authentication/auth/steps/SignupProfileStep.tsx
@@ -64,7 +64,7 @@ export function SignupProfileStep(): JSX.Element {
)
return (
- <AuthSceneCard footer={footer}>
+ <AuthSceneCard footer={footer} showPendingConnection>
<AuthCardTitle
title="Tell us about yourself"
sub={
diff --git a/frontend/src/scenes/authentication/cli/CLIAuthorize.tsx b/frontend/src/scenes/authentication/cli/CLIAuthorize.tsx
index 9b5ba189b6ba..805893e7e570 100644
--- a/frontend/src/scenes/authentication/cli/CLIAuthorize.tsx
+++ b/frontend/src/scenes/authentication/cli/CLIAuthorize.tsx
@@ -4,12 +4,14 @@ import { Form } from 'kea-forms'
import { IconCode } from '@posthog/icons'
import { LemonButton, LemonInput, LemonSelect, Link } from '@posthog/lemon-ui'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import { ScopeAccessRow } from 'lib/components/ScopeAccessRow/ScopeAccessRow'
import { IconErrorOutline } from 'lib/lemon-ui/icons'
-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { LemonField } from 'lib/lemon-ui/LemonField'
import type { ScopeAccessLevel } from 'lib/scopes'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -42,220 +44,229 @@ export function CLIAuthorize(): JSX.Element {
useActions(cliAuthorizeLogic)
return (
- <BridgePage view="login">
- {isSuccess ? (
- <div className="text-center space-y-4">
- <h2>CLI Authorization Complete</h2>
- <LemonBanner type="success">
- <div className="space-y-2">
- <p className="font-semibold">Your CLI has been authorized successfully!</p>
- <p>You can now close this window and return to your terminal.</p>
- </div>
- </LemonBanner>
- <div className="text-muted text-sm mt-4">
- <p>
- A personal API key has been created for your CLI. You can manage your personal API keys in{' '}
- <Link to={urls.settings('user-api-keys')} className="font-semibold">
+ <AuthScene notes={isSuccess ? AUTH_NOTES.cliAuthorize.authorized : AUTH_NOTES.cliAuthorize.authorize}>
+ <AuthSceneCard>
+ {isSuccess ? (
+ <>
+ <AuthCardTitle title="CLI authorized" sub="Back to the terminal you go." />
+ <AuthBanner variant="success">
+ <p className="m-0 font-semibold">Your CLI has been authorized successfully!</p>
+ <p className="m-0">You can now close this window and return to your terminal.</p>
+ </AuthBanner>
+ <p className="mt-4 mb-0 text-sm text-secondary text-center">
+ <span>A personal API key was created for your CLI. Manage it in</span>{' '}
+ <Link
+ to={urls.settings('user-api-keys')}
+ className="font-semibold no-underline cursor-pointer hover:underline hover:underline-offset-2 text-warning"
+ >
Settings → Personal API keys
</Link>
</p>
- </div>
- </div>
- ) : (
- <div className="space-y-4">
- <h2>Authorize CLI Access</h2>
- <p className="text-muted text-sm">
- The PostHog CLI should have displayed a 9-character code (e.g., ABCD-1234). Enter it below to
- authorize your CLI.
- </p>
- <Form logic={cliAuthorizeLogic} formKey="authorize" enableFormOnSubmit className="space-y-4">
- <LemonField name="userCode" label="Authorization Code">
- <LemonInput
- className="ph-ignore-input font-mono text-lg tracking-wider"
- autoFocus
- data-attr="cli-auth-code"
- placeholder="ABCD-1234"
- maxLength={9}
- value={authorize.userCode}
- onChange={(value) => setAuthorizeValue('userCode', value.toUpperCase())}
- autoComplete="off"
- autoCorrect="off"
- autoCapitalize="characters"
- spellCheck={false}
- />
- </LemonField>
- <LemonField name="organizationId" label="Organization">
- <LemonSelect
- data-attr="cli-organization-select"
- placeholder="Select an organization"
- value={authorize.organizationId}
- onChange={(value) => setAuthorizeValue('organizationId', value)}
- options={organizations.map((organization) => ({
- label: organization.name,
- value: organization.id,
- }))}
- />
- </LemonField>
- <LemonField name="projectId" label="Project">
- <LemonSelect
- data-attr="cli-project-select"
- placeholder="Select a project"
- value={authorize.projectId}
- onChange={(value) => setAuthorizeValue('projectId', value)}
- disabled={!authorize.organizationId}
- options={projects.map((project: { id: number; name: string }) => ({
- label: project.name,
- value: project.id,
- }))}
- loading={projectsLoading}
- />
- </LemonField>
-
- <div className="flex items-center justify-between mt-4 mb-2">
- <h3 className="mb-0">Scopes</h3>
- <LemonSelect
- data-attr="cli-scope-preset"
- size="small"
- placeholder="Custom selection"
- value={scopePreset}
- onChange={(value) => setScopePreset(value)}
- options={CLI_SCOPE_PRESETS.map((preset) => ({
- label: preset.label,
- value: preset.value,
- }))}
- dropdownMatchSelectWidth={false}
- dropdownPlacement="bottom-end"
- />
- </div>
- <p className="text-muted text-sm mb-2">
- Permissions granted to the CLI. Pick a preset or fine-tune individual scopes. Only grant
- what you need.
- </p>
+ </>
+ ) : (
+ <>
+ <AuthCardTitle
+ title="Authorize CLI access"
+ sub="Type the code your terminal showed you, like ABCD-1234."
+ />
+ <Form
+ logic={cliAuthorizeLogic}
+ formKey="authorize"
+ enableFormOnSubmit
+ className="flex flex-col gap-4"
+ >
+ <LemonField name="userCode" label="Authorization code">
+ <LemonInput
+ className="ph-ignore-input font-mono text-lg tracking-wider"
+ autoFocus
+ data-attr="cli-auth-code"
+ placeholder="ABCD-1234"
+ maxLength={9}
+ value={authorize.userCode}
+ onChange={(value) => setAuthorizeValue('userCode', value.toUpperCase())}
+ autoComplete="off"
+ autoCorrect="off"
+ autoCapitalize="characters"
+ spellCheck={false}
+ />
+ </LemonField>
+ <LemonField name="organizationId" label="Organization">
+ <LemonSelect
+ data-attr="cli-organization-select"
+ placeholder="Select an organization"
+ value={authorize.organizationId}
+ onChange={(value) => setAuthorizeValue('organizationId', value)}
+ options={organizations.map((organization) => ({
+ label: organization.name,
+ value: organization.id,
+ }))}
+ />
+ </LemonField>
+ <LemonField name="projectId" label="Project">
+ <LemonSelect
+ data-attr="cli-project-select"
+ placeholder="Select a project"
+ value={authorize.projectId}
+ onChange={(value) => setAuthorizeValue('projectId', value)}
+ disabled={!authorize.organizationId}
+ options={projects.map((project: { id: number; name: string }) => ({
+ label: project.name,
+ value: project.id,
+ }))}
+ loading={projectsLoading}
+ />
+ </LemonField>
- <LemonField name="scopes">
- {({ error }) => (
- <>
- {error && (
- <div className="text-danger flex items-center gap-1 text-sm mb-2">
- <IconErrorOutline className="text-xl" /> {error}
- </div>
- )}
+ <div className="flex items-center justify-between mt-2">
+ <span className="font-semibold">Scopes</span>
+ <LemonSelect
+ data-attr="cli-scope-preset"
+ size="small"
+ placeholder="Custom selection"
+ value={scopePreset}
+ onChange={(value) => setScopePreset(value)}
+ options={CLI_SCOPE_PRESETS.map((preset) => ({
+ label: preset.label,
+ value: preset.value,
+ }))}
+ dropdownMatchSelectWidth={false}
+ dropdownPlacement="bottom-end"
+ />
+ </div>
+ <p className="-mt-2 mb-0 text-sm text-secondary">
+ Pick a preset or fine-tune individual scopes.
+ </p>
- {allAccessSelected ? (
- <LemonBanner
- type="warning"
- action={{ children: 'Reset', onClick: () => resetScopes() }}
- >
- <b>This key will have full access to all supported endpoints.</b> We
- recommend scoping it to only what the CLI needs.
- </LemonBanner>
- ) : (
- <>
- <LemonInput
- type="search"
- placeholder="Search scopes..."
- value={searchTerm}
- onChange={setSearchTerm}
- className="mb-2"
- size="small"
- fullWidth
- />
- <div className="max-h-64 overflow-y-auto pr-1">
- {filteredScopes.length === 0 ? (
- <div className="text-muted text-sm py-2">
- No scopes match "{searchTerm}"
- </div>
- ) : (
- filteredScopes.map(
- ({ key, objectName, disabledActions, warnings, info }) => {
- const value = (formScopeRadioValues[key] ??
- 'none') as ScopeAccessLevel
- const disabledReason = (
- action: 'read' | 'write'
- ): string | undefined =>
- disabledActions?.includes(action)
- ? 'Does not apply to this resource'
- : undefined
- return (
- <ScopeAccessRow
- key={key}
- row={{
- key,
- label: objectName,
- info,
- value,
- warning:
- value === 'none'
- ? undefined
- : warnings?.[value],
- disabledReasons: {
- read: disabledReason('read'),
- write: disabledReason('write'),
- },
- }}
- onChange={setScopeRadioValue}
- />
- )
- }
- )
- )}
+ <LemonField name="scopes">
+ {({ error }) => (
+ <>
+ {error && (
+ <div className="text-danger flex items-center gap-1 text-sm mb-2">
+ <IconErrorOutline className="text-xl" /> {error}
</div>
- </>
- )}
- </>
- )}
- </LemonField>
+ )}
- {(missingSchemaScopes ||
- missingErrorTrackingScopes ||
- missingEndpointsScopes ||
- missingAgentScopes) && (
- <div className="space-y-2 mt-2">
- {missingSchemaScopes && (
- <LemonBanner type="warning">
- <b>Schema management unavailable:</b> The CLI needs both{' '}
- <code>event_definition</code> and <code>property_definition</code> permissions
- (read or write) to manage schemas.
- </LemonBanner>
- )}
- {missingErrorTrackingScopes && (
- <LemonBanner type="warning">
- <b>Error tracking unavailable:</b> The CLI needs <code>error_tracking</code>{' '}
- permissions (read or write) to manage error tracking.
- </LemonBanner>
- )}
- {missingEndpointsScopes && (
- <LemonBanner type="warning">
- <b>Endpoints unavailable:</b> The CLI needs <code>endpoint</code> permissions
- (read or write) to execute endpoints.
- </LemonBanner>
+ {allAccessSelected ? (
+ <AuthBanner variant="warning">
+ <p className="m-0">
+ <b>This key will have full access to all supported endpoints.</b>{' '}
+ <span>We recommend scoping it to only what the CLI needs.</span>
+ </p>
+ <Link
+ onClick={() => resetScopes()}
+ data-attr="cli-authorize-reset-scopes"
+ className="inline-block mt-1 font-semibold no-underline cursor-pointer hover:underline hover:underline-offset-2 text-warning"
+ >
+ Reset scopes
+ </Link>
+ </AuthBanner>
+ ) : (
+ <>
+ <LemonInput
+ type="search"
+ placeholder="Search scopes..."
+ value={searchTerm}
+ onChange={setSearchTerm}
+ className="mb-2"
+ size="small"
+ fullWidth
+ />
+ <div className="max-h-64 overflow-y-auto pr-1">
+ {filteredScopes.length === 0 ? (
+ <div className="text-muted text-sm py-2">
+ No scopes match "{searchTerm}"
+ </div>
+ ) : (
+ filteredScopes.map(
+ ({ key, objectName, disabledActions, warnings, info }) => {
+ const value = (formScopeRadioValues[key] ??
+ 'none') as ScopeAccessLevel
+ const disabledReason = (
+ action: 'read' | 'write'
+ ): string | undefined =>
+ disabledActions?.includes(action)
+ ? 'Does not apply to this resource'
+ : undefined
+ return (
+ <ScopeAccessRow
+ key={key}
+ row={{
+ key,
+ label: objectName,
+ info,
+ value,
+ warning:
+ value === 'none'
+ ? undefined
+ : warnings?.[value],
+ disabledReasons: {
+ read: disabledReason('read'),
+ write: disabledReason('write'),
+ },
+ }}
+ onChange={setScopeRadioValue}
+ />
+ )
+ }
+ )
+ )}
+ </div>
+ </>
+ )}
+ </>
)}
- {missingAgentScopes && (
- <LemonBanner type="warning">
- <b>Agent commands limited:</b> The CLI's <code>api</code> commands need{' '}
- <code>user</code>, <code>project</code>, and <code>query</code> permissions
- (read or write) to discover data and run queries.
- </LemonBanner>
- )}
- </div>
- )}
+ </LemonField>
- <LemonButton
- type="primary"
- status="alt"
- htmlType="submit"
- data-attr="cli-authorize-submit"
- fullWidth
- center
- loading={isAuthorizeSubmitting}
- size="large"
- icon={<IconCode />}
- >
- Authorize CLI
- </LemonButton>
- </Form>
- </div>
- )}
- </BridgePage>
+ {(missingSchemaScopes ||
+ missingErrorTrackingScopes ||
+ missingEndpointsScopes ||
+ missingAgentScopes) && (
+ <div className="flex flex-col gap-2">
+ {missingSchemaScopes && (
+ <AuthBanner variant="warning">
+ <b>Schema management unavailable:</b> The CLI needs both{' '}
+ <code>event_definition</code> and <code>property_definition</code>{' '}
+ permissions (read or write) to manage schemas.
+ </AuthBanner>
+ )}
+ {missingErrorTrackingScopes && (
+ <AuthBanner variant="warning">
+ <b>Error tracking unavailable:</b> The CLI needs <code>error_tracking</code>{' '}
+ permissions (read or write) to manage error tracking.
+ </AuthBanner>
+ )}
+ {missingEndpointsScopes && (
+ <AuthBanner variant="warning">
+ <b>Endpoints unavailable:</b> The CLI needs <code>endpoint</code>{' '}
+ permissions (read or write) to execute endpoints.
+ </AuthBanner>
+ )}
+ {missingAgentScopes && (
+ <AuthBanner variant="warning">
+ <b>Agent commands limited:</b> The CLI's <code>api</code> commands need{' '}
+ <code>user</code>, <code>project</code>, and <code>query</code> permissions
+ (read or write) to discover data and run queries.
+ </AuthBanner>
+ )}
+ </div>
+ )}
+
+ <LemonButton
+ type="primary"
+ htmlType="submit"
+ data-attr="cli-authorize-submit"
+ fullWidth
+ center
+ loading={isAuthorizeSubmitting}
+ size="large"
+ icon={<IconCode />}
+ >
+ Authorize CLI
+ </LemonButton>
+ </Form>
+ </>
+ )}
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/authentication/cli/CLILive.tsx b/frontend/src/scenes/authentication/cli/CLILive.tsx
index bb751bb2bda0..dff5601fc220 100644
--- a/frontend/src/scenes/authentication/cli/CLILive.tsx
+++ b/frontend/src/scenes/authentication/cli/CLILive.tsx
@@ -1,10 +1,13 @@
import { useActions, useValues } from 'kea'
+import { type ReactNode } from 'react'
import { LemonSelect } from '@posthog/lemon-ui'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
-import { SpinnerOverlay } from 'lib/lemon-ui/Spinner'
+import { Spinner } from 'lib/lemon-ui/Spinner'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES, type AuthNotes } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { cliLiveLogic } from './cliLiveLogic'
@@ -14,82 +17,85 @@ export const scene: SceneExport = {
logic: cliLiveLogic,
}
+function CLILiveCard({
+ title,
+ sub,
+ notes = AUTH_NOTES.cliLive.default,
+ children,
+}: {
+ title: string
+ sub?: string
+ notes?: AuthNotes
+ children?: ReactNode
+}): JSX.Element {
+ return (
+ <AuthScene notes={notes}>
+ <AuthSceneCard>
+ <AuthCardTitle title={title} sub={sub} />
+ {children}
+ </AuthSceneCard>
+ </AuthScene>
+ )
+}
+
export function CLILive(): JSX.Element {
const { port, projects, projectsLoading, error, redirected, selectedProjectId } = useValues(cliLiveLogic)
const { selectProject } = useActions(cliLiveLogic)
if (!port) {
return (
- <BridgePage view="login">
- <div className="text-center space-y-4">
- <h2>Missing port parameter</h2>
- <LemonBanner type="error">
- This page should be opened from the PostHog Live TUI. Please run <code>posthog-live</code> in
- your terminal.
- </LemonBanner>
- </div>
- </BridgePage>
+ <CLILiveCard title="Missing port parameter" notes={AUTH_NOTES.cliLive.error}>
+ <AuthBanner variant="danger">
+ This page should be opened from the PostHog Live TUI. Please run <code>posthog-live</code> in your
+ terminal.
+ </AuthBanner>
+ </CLILiveCard>
)
}
if (redirected) {
return (
- <BridgePage view="login">
- <div className="text-center space-y-4">
- <h2>Authorization complete</h2>
- <LemonBanner type="success">
- <div className="space-y-2">
- <p className="font-semibold">You can close this tab and return to your terminal.</p>
- </div>
- </LemonBanner>
- </div>
- </BridgePage>
+ <CLILiveCard title="Authorization complete" notes={AUTH_NOTES.cliLive.authorized}>
+ <AuthBanner variant="success">You can close this tab and return to your terminal.</AuthBanner>
+ </CLILiveCard>
)
}
if (error) {
return (
- <BridgePage view="login">
- <div className="text-center space-y-4">
- <h2>Authorization failed</h2>
- <LemonBanner type="error">{error}</LemonBanner>
- </div>
- </BridgePage>
+ <CLILiveCard title="Authorization failed" notes={AUTH_NOTES.cliLive.error}>
+ <AuthBanner variant="danger">{error}</AuthBanner>
+ </CLILiveCard>
)
}
if (projectsLoading || projects.length === 1) {
return (
- <BridgePage view="login">
- <div className="text-center space-y-4">
- <h2>Authorizing PostHog Live...</h2>
- <SpinnerOverlay />
+ <CLILiveCard title="Authorizing PostHog Live…">
+ <div className="flex justify-center">
+ <Spinner className="text-2xl" />
</div>
- </BridgePage>
+ </CLILiveCard>
)
}
return (
- <BridgePage view="login">
- <div className="space-y-4">
- <h2>Select a project</h2>
- <p className="text-muted text-sm">Choose which project to stream live events from.</p>
- <LemonSelect
- data-attr="cli-live-project-select"
- placeholder="Select a project"
- value={selectedProjectId}
- onChange={(value) => {
- if (value) {
- selectProject(value)
- }
- }}
- options={projects.map((project) => ({
- label: project.name,
- value: project.id,
- }))}
- fullWidth
- />
- </div>
- </BridgePage>
+ <CLILiveCard title="Select a project" sub="Pick the project to stream live events from.">
+ <LemonSelect
+ data-attr="cli-live-project-select"
+ placeholder="Select a project"
+ value={selectedProjectId}
+ onChange={(value) => {
+ if (value) {
+ selectProject(value)
+ }
+ }}
+ options={projects.map((project) => ({
+ label: project.name,
+ value: project.id,
+ }))}
+ fullWidth
+ />
+ </CLILiveCard>
)
}
diff --git a/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx b/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
index ebb15d40ff71..b676b2d18402 100644
--- a/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
+++ b/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
@@ -20,7 +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/auth/loginLogic'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { OrgTile } from 'scenes/authentication/shared/authScene/OrgTile'
import { TurnstileChallenge } from 'scenes/authentication/shared/TurnstileChallenge'
@@ -158,12 +160,12 @@ function InviteNewUser({ invite }: { invite: PrevalidatedInvite }): JSX.Element
)
return (
- <AuthScene notes={["// you've been invited", `// ${org.toLowerCase()} is waiting`]}>
+ <AuthScene notes={AUTH_NOTES.inviteSignup.invited(org)}>
<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.'}{' '}
+ <AuthBanner variant="danger" className="mb-4">
+ <span>{signupManualErrors.generic.detail || 'Could not complete your signup.'}</span>{' '}
<Link
data-attr="invite-signup-error-contact-support"
onClick={() => openSupportForm({ kind: 'support' })}
@@ -171,12 +173,12 @@ function InviteNewUser({ invite }: { invite: PrevalidatedInvite }): JSX.Element
>
Need help?
</Link>
- </div>
+ </AuthBanner>
)}
{passkeyError && (
- <div className="mb-4 py-2.5 px-3 text-sm leading-normal text-primary text-left bg-danger-highlight border border-danger rounded">
+ <AuthBanner variant="danger" className="mb-4">
{passkeyError}
- </div>
+ </AuthBanner>
)}
<Form logic={inviteSignupLogic} formKey="signup" enableFormOnSubmit className="flex flex-col gap-4">
<LemonField.Pure label="Email" help="The invite is tied to this address.">
@@ -296,7 +298,7 @@ function InviteExistingAccount({ invite }: { invite: PrevalidatedInvite }): JSX.
const org = invite.organization_name
return (
- <AuthScene notes={['// hey, welcome back', '// one more org for you']}>
+ <AuthScene notes={AUTH_NOTES.inviteSignup.existingUser}>
<AuthSceneCard>
<div className="mb-4 flex justify-center">
<OrgTile name={org} />
@@ -444,7 +446,7 @@ function InviteInvalid(): JSX.Element {
)
return (
- <AuthScene notes={['// hmm', "// this invite isn't right"]}>
+ <AuthScene notes={AUTH_NOTES.inviteSignup.invalid}>
<AuthSceneCard footer={footer}>
<div className="flex flex-col items-center text-center">
<HedgehogJudge className="block w-auto mx-auto h-28" />
diff --git a/frontend/src/scenes/authentication/login-2fa/Login2FA.tsx b/frontend/src/scenes/authentication/login-2fa/Login2FA.tsx
index 30a2699dbf63..b0f59e431f2b 100644
--- a/frontend/src/scenes/authentication/login-2fa/Login2FA.tsx
+++ b/frontend/src/scenes/authentication/login-2fa/Login2FA.tsx
@@ -3,12 +3,14 @@ import { Form } from 'kea-forms'
import { LemonButton, LemonDivider, LemonInput } from '@posthog/lemon-ui'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import passkeyLogo from 'lib/components/SocialLoginButton/passkey.svg'
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 { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { loginTelemetryLogic } from 'scenes/authentication/shared/loginTelemetryLogic'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { SceneExport } from 'scenes/sceneTypes'
@@ -28,55 +30,62 @@ export function Login2FA(): JSX.Element {
const { openSupportForm } = useActions(supportLogic)
return (
- <BridgePage view="login">
- <div className="deprecated-space-y-2">
- <h2>Two-Factor Authentication</h2>
- <p>
- <span>Enter a token from your authenticator app, use your passkey, or enter a backup code.</span>
- {preflight?.cloud && (
+ <AuthScene notes={AUTH_NOTES.login2fa.default}>
+ <AuthSceneCard showPendingConnection>
+ <AuthCardTitle
+ title="Two-factor authentication"
+ sub={
<>
- {' '}
- <Link
- data-attr="2fa-contact-support"
- onClick={(e) => {
- e.preventDefault()
- openSupportForm({
- kind: 'support',
- })
- }}
- >
- Need help?
- </Link>
+ <span>Your passkey, an authenticator code or a backup code will do.</span>
+ {preflight?.cloud && (
+ <>
+ {' '}
+ <Link
+ data-attr="2fa-contact-support"
+ onClick={(e) => {
+ e.preventDefault()
+ openSupportForm({
+ kind: 'support',
+ })
+ }}
+ className="font-semibold no-underline cursor-pointer hover:underline hover:underline-offset-2 text-warning"
+ >
+ Need help?
+ </Link>
+ </>
+ )}
</>
- )}
- </p>
-
+ }
+ />
+ {generalError && (
+ <AuthBanner variant="danger" className="mb-4">
+ {generalError.detail}
+ </AuthBanner>
+ )}
{passkeysAvailable && (
<>
<LemonButton
- type="primary"
+ type="secondary"
htmlType="button"
onClick={() => beginPasskey2FA()}
loading={passkey2FALoading}
fullWidth
center
size="large"
- icon={<img src={passkeyLogo} alt="Passkey" className="object-contain w-6 h-6" />}
+ icon={<img src={passkeyLogo} alt="Passkey" className="object-contain w-7 h-7" />}
>
Use passkey
</LemonButton>
- {totpAvailable && <LemonDivider className="my-4" label="Or" />}
+ {totpAvailable && <LemonDivider className="my-4" label="or use a code" />}
</>
)}
-
{totpAvailable && (
<Form
logic={login2FALogic}
formKey="twofactortoken"
enableFormOnSubmit
- className="deprecated-space-y-4"
+ className="flex flex-col gap-4"
>
- {generalError && <LemonBanner type="error">{generalError.detail}</LemonBanner>}
<LemonField name="token" label="Authenticator token">
<LemonInput
className="ph-ignore-input"
@@ -85,11 +94,11 @@ export function Login2FA(): JSX.Element {
placeholder="123456"
inputMode="numeric"
autoComplete="one-time-code"
+ fullWidth
/>
</LemonField>
<LemonButton
type="primary"
- status="alt"
htmlType="submit"
data-attr="2fa-login"
fullWidth
@@ -97,18 +106,17 @@ export function Login2FA(): JSX.Element {
loading={isTwofactortokenSubmitting}
size="large"
>
- Login
+ Log in
</LemonButton>
</Form>
)}
-
{!passkeysAvailable && !totpAvailable && (
- <LemonBanner type="error">
+ <AuthBanner variant="danger">
No 2FA methods available. Please contact support if you believe this is an error.
- </LemonBanner>
+ </AuthBanner>
)}
- </div>
- </BridgePage>
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/authentication/password-reset/PasswordReset.tsx b/frontend/src/scenes/authentication/password-reset/PasswordReset.tsx
index 048d5eee058c..3f741c230de0 100644
--- a/frontend/src/scenes/authentication/password-reset/PasswordReset.tsx
+++ b/frontend/src/scenes/authentication/password-reset/PasswordReset.tsx
@@ -9,11 +9,13 @@ import { useEffect } from 'react'
import { IconCheckCircle } from '@posthog/icons'
import { LemonButton, LemonDivider, LemonInput, Link } from '@posthog/lemon-ui'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import { CodeSnippet, Language } from 'lib/components/CodeSnippet'
import { IconErrorOutline } from 'lib/lemon-ui/icons'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { loginTelemetryLogic } from 'scenes/authentication/shared/loginTelemetryLogic'
import { SupportModalButton } from 'scenes/authentication/shared/SupportModalButton'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
@@ -39,38 +41,63 @@ export function PasswordReset(): JSX.Element {
}
}, [resetRequestPasswordReset])
+ const isThrottled = requestPasswordResetManualErrors?.code === 'throttled'
+ const emailUnavailable = !preflightLoading && !preflight?.email_service_available
+ const notes = emailUnavailable
+ ? AUTH_NOTES.passwordReset.emailUnavailable
+ : isThrottled
+ ? AUTH_NOTES.passwordReset.throttled
+ : requestPasswordResetSucceeded
+ ? AUTH_NOTES.passwordReset.sent
+ : AUTH_NOTES.passwordReset.request
+
return (
- <BridgePage view="password-reset" footer={<SupportModalButton />}>
- {requestPasswordResetManualErrors?.code === 'throttled' ? (
- <div className="text-center ">
- <IconErrorOutline className="text-5xl text-danger" />
- </div>
- ) : (
- requestPasswordResetSucceeded && (
- <div className="text-center">
- <IconCheckCircle className="text-5xl text-success" />
+ <AuthScene notes={notes}>
+ <AuthSceneCard footer={<SupportModalButton />}>
+ {isThrottled ? (
+ <div className="text-center mb-3">
+ <IconErrorOutline className="text-5xl text-danger" />
</div>
- )
- )}
- <h2>Reset password</h2>
- {preflightLoading ? (
- <Spinner />
- ) : !preflight?.email_service_available ? (
- <EmailUnavailable />
- ) : requestPasswordResetManualErrors?.code === 'throttled' ? (
- <ResetThrottled />
- ) : requestPasswordResetSucceeded ? (
- <ResetSuccess />
- ) : (
- <ResetForm />
- )}
- </BridgePage>
+ ) : (
+ requestPasswordResetSucceeded && (
+ <div className="text-center mb-3">
+ <IconCheckCircle className="text-5xl text-success" />
+ </div>
+ )
+ )}
+ <AuthCardTitle
+ title={
+ isThrottled
+ ? 'Too many requests'
+ : requestPasswordResetSucceeded
+ ? 'Check your inbox'
+ : 'Forgot your password?'
+ }
+ sub={
+ !isThrottled && !requestPasswordResetSucceeded && !emailUnavailable
+ ? "Happens to everyone. We'll email you a link."
+ : undefined
+ }
+ />
+ {preflightLoading ? (
+ <Spinner />
+ ) : emailUnavailable ? (
+ <EmailUnavailable />
+ ) : isThrottled ? (
+ <ResetThrottled />
+ ) : requestPasswordResetSucceeded ? (
+ <ResetSuccess />
+ ) : (
+ <ResetForm />
+ )}
+ </AuthSceneCard>
+ </AuthScene>
)
}
function EmailUnavailable(): JSX.Element {
return (
- <div>
+ <div className="text-sm">
<div>
Self-serve password reset is unavailable. Please <b>contact your instance administrator</b> to reset
your password.
@@ -105,26 +132,23 @@ function ResetForm(): JSX.Element {
<Form
logic={passwordResetLogic}
formKey="requestPasswordReset"
- className="deprecated-space-y-4"
+ className="flex flex-col gap-4"
enableFormOnSubmit
>
- <div className="text-center">
- Enter your email address. If an account exists, you’ll receive an email with a password reset link soon.
- </div>
<LemonField name="email" label="Email">
<LemonInput
className="ph-ignore-input"
autoFocus
data-attr="reset-email"
- placeholder="[email protected]"
+ placeholder="[email protected]"
type="email"
disabled={isRequestPasswordResetSubmitting}
+ fullWidth
/>
</LemonField>
<LemonButton
fullWidth
type="primary"
- status="alt"
center
htmlType="submit"
data-attr="password-reset"
@@ -142,13 +166,12 @@ function ResetSuccess(): JSX.Element {
const { push } = useActions(router)
return (
- <div className="text-center">
+ <div className="text-center text-sm text-secondary">
Request received successfully! If the email <b>{requestPasswordReset?.email || 'you typed'}</b> exists,
you’ll receive an email with a reset link soon.
<div className="mt-4">
<LemonButton
type="primary"
- status="alt"
data-attr="back-to-login"
center
fullWidth
@@ -167,13 +190,12 @@ function ResetThrottled(): JSX.Element {
const { push } = useActions(router)
return (
- <div className="text-center">
+ <div className="text-center text-sm text-secondary">
There have been too many reset requests for the email <b>{requestPasswordReset?.email || 'you typed'}</b>.
Please try again later or contact support if you think this has been a mistake.
<div className="mt-4">
<LemonButton
type="primary"
- status="alt"
data-attr="back-to-login"
center
fullWidth
diff --git a/frontend/src/scenes/authentication/password-reset/PasswordResetComplete.tsx b/frontend/src/scenes/authentication/password-reset/PasswordResetComplete.tsx
index 702bdf423dba..5cdc6f41d9aa 100644
--- a/frontend/src/scenes/authentication/password-reset/PasswordResetComplete.tsx
+++ b/frontend/src/scenes/authentication/password-reset/PasswordResetComplete.tsx
@@ -6,12 +6,14 @@ import { Form } from 'kea-forms'
import { LemonButton, LemonInput } from '@posthog/lemon-ui'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import PasswordStrength from 'lib/components/PasswordStrength'
import { IconErrorOutline } from 'lib/lemon-ui/icons'
-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -27,21 +29,30 @@ export function PasswordResetComplete(): JSX.Element {
const { validatedResetToken, validatedResetTokenLoading } = useValues(passwordResetLogic)
const invalidLink = !validatedResetTokenLoading && !validatedResetToken?.success
return (
- <BridgePage view="password-reset-complete">
- {invalidLink && (
- <div className="text-center mb-2">
- <IconErrorOutline className="text-secondary text-4xl" />
- </div>
- )}
- <h2>{invalidLink ? 'Unable to reset' : 'Set a new password'}</h2>
- {validatedResetTokenLoading ? (
- <Spinner />
- ) : !validatedResetToken?.token ? (
- <ResetInvalid />
- ) : (
- <NewPasswordForm />
- )}
- </BridgePage>
+ <AuthScene
+ notes={
+ invalidLink ? AUTH_NOTES.passwordResetComplete.invalid : AUTH_NOTES.passwordResetComplete.newPassword
+ }
+ >
+ <AuthSceneCard>
+ {invalidLink && (
+ <div className="text-center mb-3">
+ <IconErrorOutline className="text-secondary text-5xl" />
+ </div>
+ )}
+ <AuthCardTitle
+ title={invalidLink ? 'Unable to reset' : 'Set a new password'}
+ sub={invalidLink || validatedResetTokenLoading ? undefined : 'Make it a good one.'}
+ />
+ {validatedResetTokenLoading ? (
+ <Spinner />
+ ) : !validatedResetToken?.token ? (
+ <ResetInvalid />
+ ) : (
+ <NewPasswordForm />
+ )}
+ </AuthSceneCard>
+ </AuthScene>
)
}
@@ -50,19 +61,13 @@ function NewPasswordForm(): JSX.Element {
return (
<>
- <div className="text-center mb-4">Please enter a new password for your account.</div>
{!isPasswordResetSubmitting && passwordResetManualErrors.generic && (
- <LemonBanner type="error">
+ <AuthBanner variant="danger" className="mb-4">
{passwordResetManualErrors.generic?.detail ||
'Could not complete your password reset request. Please try again.'}
- </LemonBanner>
+ </AuthBanner>
)}
- <Form
- logic={passwordResetLogic}
- formKey="passwordReset"
- className="deprecated-space-y-4"
- enableFormOnSubmit
- >
+ <Form logic={passwordResetLogic} formKey="passwordReset" className="flex flex-col gap-4" enableFormOnSubmit>
<LemonField
name="password"
label={
@@ -79,16 +84,18 @@ function NewPasswordForm(): JSX.Element {
placeholder="••••••••••"
data-attr="password"
autoFocus
+ fullWidth
/>
</LemonField>
- <LemonField name="passwordConfirm" label="Confirm Password">
+ <LemonField name="passwordConfirm" label="Confirm password">
<LemonInput
autoComplete="new-password"
type="password"
className="ph-ignore-input"
placeholder="••••••••••"
data-attr="password-confirm"
+ fullWidth
/>
</LemonField>
@@ -99,6 +106,7 @@ function NewPasswordForm(): JSX.Element {
htmlType="submit"
data-attr="password-reset-complete"
loading={isPasswordResetSubmitting}
+ size="large"
>
Change my password
</LemonButton>
@@ -111,7 +119,7 @@ function ResetInvalid(): JSX.Element {
const { user } = useValues(userLogic)
return (
- <div className="text-center">
+ <div className="text-center text-sm text-secondary">
The provided link is <b>invalid or has expired</b>. Please request a new link.
<div className="mt-4">
<LemonButton
@@ -119,6 +127,7 @@ function ResetInvalid(): JSX.Element {
type="primary"
center
data-attr="back-to-login"
+ size="large"
// Scene.PasswordReset is onlyUnauthenticated, so /reset would bounce a signed-in user.
to={user ? urls.settings('user-profile', 'change-password') : urls.passwordReset()}
>
diff --git a/frontend/src/scenes/authentication/shared/OtherRegionHint.tsx b/frontend/src/scenes/authentication/shared/OtherRegionHint.tsx
deleted file mode 100644
index d1f2af2226e4..000000000000
--- a/frontend/src/scenes/authentication/shared/OtherRegionHint.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { useValues } from 'kea'
-
-import { CLOUD_HOSTNAMES } from 'lib/constants'
-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
-import { Link } from 'lib/lemon-ui/Link'
-import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
-
-import { Region } from '~/types'
-
-export function otherRegionOf(region: Region): Region {
- return region === Region.US ? Region.EU : Region.US
-}
-
-// Preserve the query string (e.g. `next`) but always land on the login page of the other region.
-export function otherRegionLoginUrl(region: Region, search: string): string {
- return `https://${CLOUD_HOSTNAMES[otherRegionOf(region)]}/login${search}`
-}
-
-/**
- * Region-aware hint for users who may be authenticating on the wrong PostHog Cloud region (US vs EU).
- *
- * Shown unconditionally whenever it's rendered on cloud — it never checks whether an account actually
- * exists on the other region, so it cannot be used to probe for account existence across regions.
- */
-export function OtherRegionHint(): JSX.Element | null {
- const { preflight } = useValues(preflightLogic)
-
- if (!preflight?.cloud || !preflight?.region) {
- return null
- }
-
- const otherRegion = otherRegionOf(preflight.region)
-
- return (
- <LemonBanner type="info">
- Already have a PostHog Cloud account? It may live in our {otherRegion} region. You're currently on{' '}
- {preflight.region}.{' '}
- <Link
- to={otherRegionLoginUrl(preflight.region, location.search)}
- disableClientSideRouting
- data-attr="other-region-login"
- >
- Log in on {CLOUD_HOSTNAMES[otherRegion]}
- </Link>
- </LemonBanner>
- )
-}
diff --git a/frontend/src/scenes/authentication/shared/WelcomeLogo.tsx b/frontend/src/scenes/authentication/shared/WelcomeLogo.tsx
deleted file mode 100644
index af98f0312991..000000000000
--- a/frontend/src/scenes/authentication/shared/WelcomeLogo.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Link } from '@posthog/lemon-ui'
-
-import { Logo } from 'lib/brand'
-
-export function WelcomeLogo({ view }: { view?: string }): JSX.Element {
- const UTM_TAGS = `utm_campaign=in-product&utm_tag=${view || 'welcome'}-header`
- const logoHref = `https://posthog.com?${UTM_TAGS}`
-
- return (
- <Link to={logoHref} className="flex flex-col items-center mb-8" aria-label="posthog.com">
- <Logo size="md" className="shrink-0" aria-hidden />
- </Link>
- )
-}
diff --git a/frontend/src/scenes/authentication/shared/authScene/AuthScene.scss b/frontend/src/scenes/authentication/shared/authScene/AuthScene.scss
index 5c5fd6f66174..222680c65f8b 100644
--- a/frontend/src/scenes/authentication/shared/authScene/AuthScene.scss
+++ b/frontend/src/scenes/authentication/shared/authScene/AuthScene.scss
@@ -181,6 +181,16 @@
}
}
+// The snapshot runner zeroes animation durations, and headless Chromium can then paint an animation's
+// first keyframe. Turn these off there, so a snapshot shows the card, caret and progress bar at rest.
+.storybook-test-runner {
+ .AuthScene__column,
+ .AuthScene__caret,
+ .AuthScene__progress-fill {
+ animation: none !important;
+ }
+}
+
@keyframes AuthScene__blink {
0%,
50% {
diff --git a/frontend/src/scenes/authentication/shared/authScene/AuthScene.tsx b/frontend/src/scenes/authentication/shared/authScene/AuthScene.tsx
index a44908276e0d..834714179577 100644
--- a/frontend/src/scenes/authentication/shared/authScene/AuthScene.tsx
+++ b/frontend/src/scenes/authentication/shared/authScene/AuthScene.tsx
@@ -1,26 +1,47 @@
import './AuthScene.scss'
+import clsx from 'clsx'
import { useValues } from 'kea'
import { type ReactNode } from 'react'
import { Logo } from 'lib/brand'
import { OAuthConnectionLogos } from 'lib/components/OAuthConnectionLogos/OAuthConnectionLogos'
+import { inStorybook } from 'lib/utils/dom'
import { pendingOAuthConnectionLogic } from '../pendingOAuthConnectionLogic'
+import { type AuthNotes } from './authNotes'
import { AuthSceneBackdrop } from './AuthSceneBackdrop'
import { DevLoginPanel } from './DevLoginPanel'
import { Typewriter } from './Typewriter'
-export function AuthScene({ notes, children }: { notes: string[]; children: ReactNode }): JSX.Element {
+export function AuthScene({
+ notes,
+ wide = false,
+ children,
+}: {
+ /** An entry from `AUTH_NOTES`. */
+ notes: AuthNotes
+ /** For a card that holds tables, such as the credential review. */
+ wide?: boolean
+ children: ReactNode
+}): JSX.Element {
return (
<AuthSceneBackdrop className="relative h-screen overflow-x-hidden overflow-y-auto">
<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
+ className={clsx(
+ 'AuthScene__column flex flex-col items-center max-w-full',
+ wide ? 'w-[48rem]' : 'w-[27rem]'
+ )}
+ >
+ {children}
+ </div>
</div>
- <DevLoginPanel />
+ {/* The dev login panel is a local tool, so stories and their snapshots leave it out */}
+ {!inStorybook() && <DevLoginPanel />}
</AuthSceneBackdrop>
)
}
@@ -29,10 +50,17 @@ export function AuthScene({ notes, children }: { notes: string[]; children: Reac
export function AuthSceneCard({
top,
footer,
+ showPendingConnection = false,
children,
}: {
top?: ReactNode
footer?: ReactNode
+ /**
+ * Shows the pending OAuth app's logo in place of the PostHog logo. Set it only on screens on the way to
+ * OAuth consent. The pending-connection cookie stays after a person abandons a connect, so on any other
+ * screen the logo suggests that the action is for that app.
+ */
+ showPendingConnection?: boolean
children: ReactNode
}): JSX.Element {
const { pendingConnection } = useValues(pendingOAuthConnectionLogic)
@@ -41,7 +69,7 @@ export function AuthSceneCard({
<>
{top !== undefined ? (
top
- ) : pendingConnection ? (
+ ) : showPendingConnection && pendingConnection ? (
<OAuthConnectionLogos appName={pendingConnection.clientName} logoUri={pendingConnection.logoUri} />
) : (
<span className="AuthScene__logo block mb-4">
diff --git a/frontend/src/scenes/authentication/shared/authScene/Typewriter.tsx b/frontend/src/scenes/authentication/shared/authScene/Typewriter.tsx
index 69a3fcbac48f..38e00931ea63 100644
--- a/frontend/src/scenes/authentication/shared/authScene/Typewriter.tsx
+++ b/frontend/src/scenes/authentication/shared/authScene/Typewriter.tsx
@@ -1,9 +1,14 @@
import { useState, useEffect } from 'react'
+import { inStorybookTestRunner } from 'lib/utils/dom'
+
/** Types the two mono corner notes (// ...), honoring reduced-motion. Presentational only. */
-export function Typewriter({ lines }: { lines: string[] }): JSX.Element {
- const full = lines.join('\n')
- const reduce = typeof window !== 'undefined' && !!window.matchMedia?.('(prefers-reduced-motion: reduce)').matches
+export function Typewriter({ lines }: { lines: readonly string[] }): JSX.Element {
+ const full = lines.map((line) => `// ${line}`).join('\n')
+ // Visual regression snapshots run without reduced motion, and the timer would leave the notes half typed
+ const reduce =
+ inStorybookTestRunner() ||
+ (typeof window !== 'undefined' && !!window.matchMedia?.('(prefers-reduced-motion: reduce)').matches)
const [shown, setShown] = useState(reduce ? full.length : 0)
useEffect(() => {
diff --git a/frontend/src/scenes/authentication/shared/authScene/authNotes.ts b/frontend/src/scenes/authentication/shared/authScene/authNotes.ts
new file mode 100644
index 000000000000..114cc368de03
--- /dev/null
+++ b/frontend/src/scenes/authentication/shared/authScene/authNotes.ts
@@ -0,0 +1,89 @@
+export type AuthNotes = readonly string[]
+
+/**
+ * The typed notes in the top-left corner of every `AuthScene`, by screen and then by state.
+ * `AuthScene` adds the `// ` prefix. Keep each line short, because the notes do not wrap.
+ */
+export const AUTH_NOTES = {
+ auth: {
+ firstVisit: ['hey, good to see you', '500,000+ teams ship here'],
+ welcomeBack: ['welcome back', '500,000+ teams ship here'],
+ createAccount: ['create an account', '1M events free, every month'],
+ signupProfile: ['almost there', 'last step'],
+ },
+ login2fa: {
+ default: ['one more step', "checking it's really you"],
+ },
+ verifyEmail: {
+ pending: ['one email away', 'we just hit send'],
+ sendFailed: ['the email did not go', 'give it another send'],
+ success: ['verified', 'go explore'],
+ invalid: ['nothing to verify', "let's start again"],
+ },
+ inviteSignup: {
+ invited: (organizationName: string): AuthNotes => [
+ "you've been invited",
+ `${organizationName.toLowerCase()} is waiting`,
+ ],
+ existingUser: ['hey, welcome back', 'one more org for you'],
+ invalid: ['hmm', "this invite isn't right"],
+ },
+ passwordReset: {
+ request: ['it happens', 'to the best of us'],
+ sent: ['check your inbox', 'a reset link is on its way'],
+ throttled: ['easy there', 'too many tries, wait a bit'],
+ emailUnavailable: ['no email on this instance', 'your admin can help'],
+ },
+ passwordResetComplete: {
+ newPassword: ['almost there', 'one new password away'],
+ invalid: ['this link stopped working', 'request a fresh one'],
+ },
+ twoFactorReset: {
+ reset: ['locked out?', "let's fix that"],
+ done: ['2fa reset', 'back in you go'],
+ invalid: ['this link stopped working', 'ask for a new one'],
+ },
+ cliAuthorize: {
+ authorize: ['hello, terminal', 'only grant what you need'],
+ authorized: ['authorized', 'your terminal has a key now'],
+ },
+ cliLive: {
+ default: ['posthog live', 'events, in your terminal'],
+ authorized: ['posthog live', 'events are on their way'],
+ error: ['posthog live', 'try again from your terminal'],
+ },
+ vercelConnect: {
+ pick: ['vercel, meet posthog', 'pick an organization'],
+ linked: ['vercel, meet posthog', "you're linked up"],
+ error: ['vercel, meet posthog', "that didn't go to plan"],
+ },
+ accountMismatch: {
+ default: ['two accounts', 'one browser'],
+ },
+ accountConnected: {
+ connected: ['all connected', 'back to work'],
+ pending: ['almost connected', 'waiting on an admin'],
+ failed: ["that didn't connect", 'give it another go'],
+ invalid: ['nothing to connect', 'this link went nowhere'],
+ },
+ credentialReview: {
+ default: ['welcome to posthog', 'quick security check'],
+ },
+ confirmOrganization: {
+ default: ['almost there', 'name your organization'],
+ },
+ unsubscribe: {
+ loading: ['one moment', 'tidying your inbox'],
+ done: ['inbox zero', 'one email lighter'],
+ failed: ['hmm', "that link didn't work"],
+ },
+ desktopBridge: {
+ default: ['posthog desktop', 'opening the app'],
+ },
+ preflight: {
+ default: ['self-hosting posthog', 'checking the plumbing'],
+ },
+ exporter: {
+ default: ['someone shared this with you', 'unlock to take a look'],
+ },
+} as const satisfies Record<string, Record<string, AuthNotes | ((...args: string[]) => AuthNotes)>>
diff --git a/frontend/src/scenes/authentication/shared/otherRegionHint.test.ts b/frontend/src/scenes/authentication/shared/otherRegion.test.ts
similarity index 92%
rename from frontend/src/scenes/authentication/shared/otherRegionHint.test.ts
rename to frontend/src/scenes/authentication/shared/otherRegion.test.ts
index e7219c2d87d4..3022a65d2acf 100644
--- a/frontend/src/scenes/authentication/shared/otherRegionHint.test.ts
+++ b/frontend/src/scenes/authentication/shared/otherRegion.test.ts
@@ -1,8 +1,8 @@
-import { otherRegionLoginUrl, otherRegionOf } from 'scenes/authentication/shared/OtherRegionHint'
+import { otherRegionLoginUrl, otherRegionOf } from 'scenes/authentication/shared/otherRegion'
import { Region } from '~/types'
-describe('OtherRegionHint', () => {
+describe('otherRegion', () => {
test.each([
['US points to EU', Region.US, Region.EU],
['EU points to US', Region.EU, Region.US],
diff --git a/frontend/src/scenes/authentication/shared/otherRegion.ts b/frontend/src/scenes/authentication/shared/otherRegion.ts
new file mode 100644
index 000000000000..b0c9e13c652c
--- /dev/null
+++ b/frontend/src/scenes/authentication/shared/otherRegion.ts
@@ -0,0 +1,12 @@
+import { CLOUD_HOSTNAMES } from 'lib/constants'
+
+import { Region } from '~/types'
+
+export function otherRegionOf(region: Region): Region {
+ return region === Region.US ? Region.EU : Region.US
+}
+
+// Preserve the query string (e.g. `next`) but always land on the login page of the other region.
+export function otherRegionLoginUrl(region: Region, search: string): string {
+ return `https://${CLOUD_HOSTNAMES[otherRegionOf(region)]}/login${search}`
+}
diff --git a/frontend/src/scenes/authentication/two-factor-reset/TwoFactorReset.tsx b/frontend/src/scenes/authentication/two-factor-reset/TwoFactorReset.tsx
index 0f050912aa2c..f5c3261372a3 100644
--- a/frontend/src/scenes/authentication/two-factor-reset/TwoFactorReset.tsx
+++ b/frontend/src/scenes/authentication/two-factor-reset/TwoFactorReset.tsx
@@ -1,9 +1,13 @@
import { useActions, useValues } from 'kea'
+import { type ReactNode } from 'react'
-import { LemonBanner, LemonButton, LemonDivider } from '@posthog/lemon-ui'
+import { LemonButton } from '@posthog/lemon-ui'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES, type AuthNotes } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -14,6 +18,27 @@ export const scene: SceneExport = {
logic: twoFactorResetLogic,
}
+function TwoFactorResetCard({
+ title,
+ sub,
+ notes = AUTH_NOTES.twoFactorReset.reset,
+ children,
+}: {
+ title: string
+ sub?: string
+ notes?: AuthNotes
+ children: ReactNode
+}): JSX.Element {
+ return (
+ <AuthScene notes={notes}>
+ <AuthSceneCard>
+ <AuthCardTitle title={title} sub={sub} />
+ <div className="flex flex-col gap-3">{children}</div>
+ </AuthSceneCard>
+ </AuthScene>
+ )
+}
+
export function TwoFactorReset(): JSX.Element {
const {
validatedResetToken,
@@ -26,107 +51,90 @@ export function TwoFactorReset(): JSX.Element {
} = useValues(twoFactorResetLogic)
const { confirmReset } = useActions(twoFactorResetLogic)
- // Show loading while validating
if (validatedResetTokenLoading) {
return (
- <BridgePage view="login">
- <div className="text-center">
- <h2>Validating reset link...</h2>
- <Spinner className="mt-4" />
+ <TwoFactorResetCard title="Checking your reset link…">
+ <div className="flex justify-center">
+ <Spinner className="text-2xl" />
</div>
- </BridgePage>
+ </TwoFactorResetCard>
)
}
- // If user needs to login first, show redirect message
if (requiresLogin) {
return (
- <BridgePage view="login">
- <div className="space-y-4">
- <h2>Login required</h2>
- <p>Please log in with your email and password first to reset your two-factor authentication.</p>
- <LemonButton fullWidth type="primary" center data-attr="login-to-reset" to={loginRedirectUrl}>
- Log in to continue
- </LemonButton>
- </div>
- </BridgePage>
+ <TwoFactorResetCard title="Log in first" sub="Use your email and password, then we'll reset your 2FA.">
+ <LemonButton
+ fullWidth
+ type="primary"
+ center
+ size="large"
+ data-attr="login-to-reset"
+ to={loginRedirectUrl}
+ >
+ Log in to continue
+ </LemonButton>
+ </TwoFactorResetCard>
)
}
- // Show success state
if (resetComplete) {
return (
- <BridgePage view="login">
- <div className="space-y-4">
- <h2>2FA has been reset</h2>
- <p>
- Your two-factor authentication settings have been successfully reset. You can now log in without
- 2FA.
- </p>
- <p>We recommend setting up 2FA again after logging in to keep your account secure.</p>
- <LemonButton fullWidth type="primary" center data-attr="back-to-login" to={urls.login()}>
- Log in
- </LemonButton>
- </div>
- </BridgePage>
+ <TwoFactorResetCard
+ title="2FA has been reset"
+ sub="You can log in without 2FA now."
+ notes={AUTH_NOTES.twoFactorReset.done}
+ >
+ <AuthBanner variant="note">
+ We recommend setting up 2FA again after logging in to keep your account secure.
+ </AuthBanner>
+ <LemonButton fullWidth type="primary" center size="large" data-attr="back-to-login" to={urls.login()}>
+ Log in
+ </LemonButton>
+ </TwoFactorResetCard>
)
}
- // Invalid or expired link
- const invalidLink = !validatedResetToken?.success
+ if (!validatedResetToken?.success) {
+ return (
+ <TwoFactorResetCard title="Unable to reset 2FA" notes={AUTH_NOTES.twoFactorReset.invalid}>
+ <AuthBanner variant="danger">
+ {validatedResetToken?.error ||
+ 'This reset link is invalid or has expired. Please contact your administrator to request a new link.'}
+ </AuthBanner>
+ <LemonButton fullWidth type="primary" center size="large" data-attr="back-to-login" to={urls.login()}>
+ Back to login
+ </LemonButton>
+ </TwoFactorResetCard>
+ )
+ }
return (
- <BridgePage view="login">
- <div className="space-y-4">
- {invalidLink ? (
- <>
- <h2>Unable to reset 2FA</h2>
- <LemonBanner type="error">
- {validatedResetToken?.error ||
- 'This reset link is invalid or has expired. Please contact your administrator to request a new link.'}
- </LemonBanner>
- <LemonButton fullWidth type="primary" center data-attr="back-to-login" to={urls.login()}>
- Back to login
- </LemonButton>
- </>
- ) : (
- <>
- <h2>Reset two-factor authentication</h2>
- <p>You are about to reset your two-factor authentication settings. This will:</p>
- <ul className="list-disc list-inside text-sm">
- <li>Remove your TOTP authenticator device</li>
- <li>Delete your backup codes</li>
- <li>Disable passkey-based 2FA (your passkeys will still work for login)</li>
- </ul>
-
- <LemonDivider className="my-4" />
-
- <p className="text-sm text-muted">After resetting, you will need to log in again.</p>
-
- {resetError && (
- <LemonBanner type="error" className="mt-4">
- {resetError}
- </LemonBanner>
- )}
-
- <LemonButton
- fullWidth
- type="primary"
- status="danger"
- center
- data-attr="confirm-2fa-reset"
- loading={resetLoading}
- onClick={() => confirmReset(validatedResetToken.token!)}
- >
- Confirm and reset 2FA
- </LemonButton>
-
- <LemonButton fullWidth type="secondary" center data-attr="cancel-2fa-reset" to={urls.login()}>
- Cancel
- </LemonButton>
- </>
- )}
- </div>
- </BridgePage>
+ <TwoFactorResetCard title="Reset two-factor authentication" sub="After this, you'll log in again.">
+ <AuthBanner variant="note">
+ <p className="m-0 mb-1.5 font-semibold text-primary">This will:</p>
+ <ul className="m-0 pl-4 list-disc">
+ <li>Remove your TOTP authenticator device</li>
+ <li>Delete your backup codes</li>
+ <li>Disable passkey-based 2FA (your passkeys will still work for login)</li>
+ </ul>
+ </AuthBanner>
+ {resetError && <AuthBanner variant="danger">{resetError}</AuthBanner>}
+ <LemonButton
+ fullWidth
+ type="primary"
+ status="danger"
+ center
+ size="large"
+ data-attr="confirm-2fa-reset"
+ loading={resetLoading}
+ onClick={() => confirmReset(validatedResetToken.token!)}
+ >
+ Confirm and reset 2FA
+ </LemonButton>
+ <LemonButton fullWidth type="secondary" center size="large" data-attr="cancel-2fa-reset" to={urls.login()}>
+ Cancel
+ </LemonButton>
+ </TwoFactorResetCard>
)
}
diff --git a/frontend/src/scenes/authentication/vercel/VercelConnect.tsx b/frontend/src/scenes/authentication/vercel/VercelConnect.tsx
index 56ed51603015..fb8d0ca66ca9 100644
--- a/frontend/src/scenes/authentication/vercel/VercelConnect.tsx
+++ b/frontend/src/scenes/authentication/vercel/VercelConnect.tsx
@@ -1,12 +1,17 @@
import { useValues } from 'kea'
import { router } from 'kea-router'
-import { useEffect, useState } from 'react'
+import { type ReactNode, useEffect, useState } from 'react'
import { LemonButton, LemonSelect } from '@posthog/lemon-ui'
import { getCookie } from 'lib/api'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
+import { LemonField } from 'lib/lemon-ui/LemonField'
import { Spinner } from 'lib/lemon-ui/Spinner'
+import { capitalizeFirstLetter } from 'lib/utils/strings'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES, type AuthNotes } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
export const scene: SceneExport = {
@@ -145,27 +150,32 @@ export function VercelConnect(): JSX.Element {
if (loading) {
return (
- <BridgePage view="vercel-connect">
- <div className="text-center">
- <Spinner className="text-4xl" />
- <p className="mt-4">Loading...</p>
+ <VercelCard title="Loading your organizations…">
+ <div className="flex justify-center">
+ <Spinner className="text-2xl" />
</div>
- </BridgePage>
+ </VercelCard>
)
}
if (success) {
return (
- <BridgePage view="vercel-connect">
- <h2 className="text-center">Account linked</h2>
- <p className="text-center mb-6">
- Your PostHog organization <strong>{linkedOrgName}</strong> is now connected to Vercel.
- </p>
+ <VercelCard
+ title="Account linked"
+ notes={AUTH_NOTES.vercelConnect.linked}
+ sub={
+ <>
+ <span>Your PostHog organization</span> <strong>{linkedOrgName}</strong>{' '}
+ <span>is now connected to Vercel.</span>
+ </>
+ }
+ >
{redirectUrl ? (
<LemonButton
fullWidth
type="primary"
center
+ size="large"
onClick={() => {
window.location.href = redirectUrl
}}
@@ -173,23 +183,22 @@ export function VercelConnect(): JSX.Element {
Return to Vercel
</LemonButton>
) : (
- <LemonButton fullWidth type="primary" center to="/">
+ <LemonButton fullWidth type="primary" center size="large" to="/">
Go to PostHog
</LemonButton>
)}
- </BridgePage>
+ </VercelCard>
)
}
if (error && !sessionInfo) {
return (
- <BridgePage view="vercel-connect">
- <h2 className="text-center">Something went wrong</h2>
- <p className="text-center text-danger mb-6">{error}</p>
- <LemonButton fullWidth type="secondary" center onClick={() => window.close()}>
+ <VercelCard title="Something went wrong" notes={AUTH_NOTES.vercelConnect.error}>
+ <AuthBanner variant="danger">{error}</AuthBanner>
+ <LemonButton fullWidth type="secondary" center size="large" onClick={() => window.close()}>
Close
</LemonButton>
- </BridgePage>
+ </VercelCard>
)
}
@@ -199,59 +208,47 @@ export function VercelConnect(): JSX.Element {
const availableTeams = selectedOrgData?.teams.filter((t) => !t.already_linked) || []
return (
- <BridgePage view="vercel-connect">
- <h2 className="text-center">Connect to Vercel</h2>
- <p className="text-center mb-6">Select which PostHog organization to link to your Vercel account.</p>
-
- {error && <p className="text-danger text-center mb-4">{error}</p>}
-
+ <VercelCard title="Connect to Vercel" sub="Pick the PostHog organization to link.">
+ {error && <AuthBanner variant="danger">{error}</AuthBanner>}
{availableOrgs.length === 0 ? (
- <div className="text-center mb-6">
- <p className="text-muted">
- {linkedOrgs.length > 0
- ? 'All your organizations are already linked to Vercel.'
- : "You don't have any organizations with admin access."}
- </p>
- </div>
+ <AuthBanner variant="note">
+ {linkedOrgs.length > 0
+ ? 'All your organizations are already linked to Vercel.'
+ : "You don't have any organizations with admin access."}
+ </AuthBanner>
) : (
<>
- <div className="mb-6">
- <LemonSelect
- fullWidth
- placeholder="Select an organization"
- value={selectedOrg}
- onChange={(value) => setSelectedOrg(value)}
- options={availableOrgs.map((org) => ({
- value: org.id,
- label: org.name,
- }))}
- />
- </div>
-
- {selectedOrg && availableTeams.length > 0 && (
- <div className="mb-6 space-y-3">
- {(['production', 'preview', 'development'] as const).map((env) => (
- <div key={env}>
- <label className="text-xs font-medium text-muted uppercase mb-1 block">{env}</label>
- <LemonSelect
- fullWidth
- placeholder="Select a project"
- value={envMapping[env]}
- onChange={(value) => setEnvMapping((prev) => ({ ...prev, [env]: value }))}
- options={availableTeams.map((t) => ({
- value: t.id,
- label: t.name,
- }))}
- />
- </div>
- ))}
- </div>
- )}
-
+ <LemonSelect
+ fullWidth
+ placeholder="Select an organization"
+ value={selectedOrg}
+ onChange={(value) => setSelectedOrg(value)}
+ options={availableOrgs.map((org) => ({
+ value: org.id,
+ label: org.name,
+ }))}
+ />
+ {selectedOrg &&
+ availableTeams.length > 0 &&
+ (['production', 'preview', 'development'] as const).map((env) => (
+ <LemonField.Pure key={env} label={capitalizeFirstLetter(env)}>
+ <LemonSelect
+ fullWidth
+ placeholder="Select a project"
+ value={envMapping[env]}
+ onChange={(value) => setEnvMapping((prev) => ({ ...prev, [env]: value }))}
+ options={availableTeams.map((t) => ({
+ value: t.id,
+ label: t.name,
+ }))}
+ />
+ </LemonField.Pure>
+ ))}
<LemonButton
fullWidth
type="primary"
center
+ size="large"
disabled={!selectedOrg || !envMapping.production || linking}
loading={linking}
onClick={handleLink}
@@ -260,11 +257,31 @@ export function VercelConnect(): JSX.Element {
</LemonButton>
</>
)}
-
- <LemonButton fullWidth type="secondary" center className="mt-2" onClick={() => window.close()}>
+ <LemonButton fullWidth type="secondary" center size="large" onClick={() => window.close()}>
Cancel
</LemonButton>
- </BridgePage>
+ </VercelCard>
+ )
+}
+
+function VercelCard({
+ title,
+ sub,
+ notes = AUTH_NOTES.vercelConnect.pick,
+ children,
+}: {
+ title: string
+ sub?: ReactNode
+ notes?: AuthNotes
+ children: ReactNode
+}): JSX.Element {
+ return (
+ <AuthScene notes={notes}>
+ <AuthSceneCard>
+ <AuthCardTitle title={title} sub={sub} />
+ <div className="flex flex-col gap-3">{children}</div>
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/authentication/vercel/VercelLinkError.tsx b/frontend/src/scenes/authentication/vercel/VercelLinkError.tsx
index db7ade5df5eb..5ad180411395 100644
--- a/frontend/src/scenes/authentication/vercel/VercelLinkError.tsx
+++ b/frontend/src/scenes/authentication/vercel/VercelLinkError.tsx
@@ -3,8 +3,10 @@ import { router } from 'kea-router'
import { LemonButton } from '@posthog/lemon-ui'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
-import { IconErrorOutline } from 'lib/lemon-ui/icons'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { SceneExport } from 'scenes/sceneTypes'
import { userLogic } from 'scenes/userLogic'
@@ -27,27 +29,36 @@ export function VercelLinkError(): JSX.Element {
: null
return (
- <BridgePage view="vercel-link-error">
- <div className="text-center mb-4">
- <IconErrorOutline className="text-warning text-4xl" />
- </div>
- <h2 className="text-center">Account mismatch</h2>
- <div className="text-center mb-6">
- <p className="mb-2">
- You're currently logged in as <strong>{currentEmail}</strong>, but your Vercel account is linked to{' '}
- {expectedEmail ? <strong>{expectedEmail}</strong> : 'a different account'}.
- </p>
- <p>To complete Vercel SSO, please log out and sign in with the correct account.</p>
- </div>
- <div className="flex flex-col gap-2">
- <LemonButton fullWidth type="primary" center onClick={() => logout(false, nextUrl ?? undefined)}>
- {expectedEmail ? `Log out and continue with ${expectedEmail}` : 'Log out and continue'}
- </LemonButton>
- <LemonButton fullWidth type="secondary" center to="/">
- Cancel
- </LemonButton>
- </div>
- </BridgePage>
+ <AuthScene notes={AUTH_NOTES.accountMismatch.default}>
+ <AuthSceneCard>
+ <AuthCardTitle title="Account mismatch" sub="Let's get you into the right one." />
+ <div className="flex flex-col gap-3">
+ <AuthBanner variant="warning">
+ <p className="m-0 mb-1.5">
+ <span>You're currently logged in as</span> <strong>{currentEmail}</strong>
+ <span>, but your Vercel account is linked to</span>{' '}
+ {expectedEmail ? <strong>{expectedEmail}</strong> : <span>a different account</span>}
+ <span>.</span>
+ </p>
+ <p className="m-0">
+ To complete Vercel SSO, please log out and sign in with the correct account.
+ </p>
+ </AuthBanner>
+ <LemonButton
+ fullWidth
+ type="primary"
+ center
+ size="large"
+ onClick={() => logout(false, nextUrl ?? undefined)}
+ >
+ {expectedEmail ? `Log out and continue with ${expectedEmail}` : 'Log out and continue'}
+ </LemonButton>
+ <LemonButton fullWidth type="secondary" center size="large" to="/">
+ Cancel
+ </LemonButton>
+ </div>
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/authentication/verify-email/VerifyEmail.scss b/frontend/src/scenes/authentication/verify-email/VerifyEmail.scss
deleted file mode 100644
index 7ac01bf05515..000000000000
--- a/frontend/src/scenes/authentication/verify-email/VerifyEmail.scss
+++ /dev/null
@@ -1,36 +0,0 @@
-@keyframes VerifyEmail__Progress {
- from {
- width: 0%;
- }
-
- to {
- width: 100%;
- }
-}
-
-.VerifyEmail__ProgressBar {
- // Negative offsets cancel BridgePage__content's 2rem padding so the bar reaches
- // the card's rounded bottom edge, while the wrapper's own `relative` positioning
- // keeps the anchor under our control rather than relying on BridgePage internals.
- position: absolute;
- inset: auto -2rem -2rem;
- height: 0.25rem;
- overflow: hidden;
- border-bottom-right-radius: var(--radius);
- border-bottom-left-radius: var(--radius);
-}
-
-.VerifyEmail__ProgressBarTrack {
- // Duration must match VERIFY_EMAIL_REDIRECT_DELAY_MS in verifyEmailLogic.ts.
- width: 0%;
- height: 100%;
- background-color: var(--color-accent);
- animation: VerifyEmail__Progress 2000ms linear forwards;
-}
-
-// In Storybook render the bar fully filled and un-animated so visual regression
-// snapshots are deterministic — real users always get the animation.
-.VerifyEmail__ProgressBarTrack--static {
- width: 100%;
- animation: none;
-}
diff --git a/frontend/src/scenes/authentication/verify-email/VerifyEmailForm.tsx b/frontend/src/scenes/authentication/verify-email/VerifyEmailForm.tsx
index 9d872ba7237e..3fef6ee5707e 100644
--- a/frontend/src/scenes/authentication/verify-email/VerifyEmailForm.tsx
+++ b/frontend/src/scenes/authentication/verify-email/VerifyEmailForm.tsx
@@ -7,9 +7,10 @@ import * as magnifyingGlassPng from '@posthog/brand/hoggies/png/magnifying-glass
import { pngHoggie } from 'lib/brand/hoggies'
import { supportLogic } from 'lib/components/Support/supportLogic'
-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { Link } from 'lib/lemon-ui/Link'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { pendingOAuthConnectionLogic } from 'scenes/authentication/shared/pendingOAuthConnectionLogic'
import { getPendingVerificationEmail, isValidVerificationCode } from 'scenes/authentication/shared/verificationCode'
@@ -22,13 +23,6 @@ const HedgehogExplorer = pngHoggie(explorerPng)
const HedgehogJackDawson = pngHoggie(jackDawsonPng)
const HedgehogMagnifyingGlass = pngHoggie(magnifyingGlassPng)
-const NOTES: Record<string, string[]> = {
- pending: ['// one email away', '// we just hit send'],
- send_failed: ['// the email did not go', '// give it another send'],
- success: ['// verified', '// go explore'],
- invalid: ['// nothing to verify', "// let's start again"],
-}
-
const CHECKLIST = [
'Wait 5 minutes, some email providers take a beat',
'Check spam and any firewalls you run',
@@ -63,7 +57,7 @@ function NotSeeingIt(): JSX.Element {
Not seeing it?
</button>
{open && (
- <div className="AuthScene__note mt-3 w-full py-3 px-3.5 text-xs leading-relaxed text-secondary text-left border border-dashed rounded">
+ <AuthBanner variant="note" className="mt-3 w-full">
<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) => (
@@ -111,7 +105,7 @@ function NotSeeingIt(): JSX.Element {
Contact support
</LemonButton>
</div>
- </div>
+ </AuthBanner>
)}
</>
)
@@ -181,14 +175,14 @@ function CheckYourInbox(): JSX.Element {
return (
<div className="flex flex-col items-center text-center">
{reason && (
- <LemonBanner type="info" className="w-full mb-4 text-left">
+ <AuthBanner variant="note" className="w-full mb-4">
{DEEP_LINK_NOTICE[reason]}
- </LemonBanner>
+ </AuthBanner>
)}
{!verificationEmailSent && (
- <LemonBanner type="warning" className="w-full mb-4 text-left">
+ <AuthBanner variant="warning" className="w-full mb-4">
We couldn't send your code just now. Open "Not seeing it?" below to send a new one.
- </LemonBanner>
+ </AuthBanner>
)}
<HedgehogMagnifyingGlass 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">
@@ -227,13 +221,17 @@ export function VerifyEmailForm(): JSX.Element {
const { pendingConnection } = useValues(pendingOAuthConnectionLogic)
const { openSupportForm } = useActions(supportLogic)
- const noteKey = view === 'pending' && !verificationEmailSent ? 'send_failed' : (view ?? 'pending')
- const notes = NOTES[noteKey] ?? NOTES.pending
+ const notes =
+ view === 'success' || view === 'invalid'
+ ? AUTH_NOTES.verifyEmail[view]
+ : view === 'pending' && !verificationEmailSent
+ ? AUTH_NOTES.verifyEmail.sendFailed
+ : AUTH_NOTES.verifyEmail.pending
if (view === 'success') {
return (
<AuthScene notes={notes}>
- <AuthSceneCard>
+ <AuthSceneCard showPendingConnection>
<div className="flex flex-col items-center text-center">
<HedgehogExplorer 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">
@@ -258,6 +256,7 @@ export function VerifyEmailForm(): JSX.Element {
return (
<AuthScene notes={notes}>
<AuthSceneCard
+ showPendingConnection
footer={
<p className="mt-5 mb-0 text-sm text-secondary text-center">
Already verified?{' '}
@@ -305,6 +304,7 @@ export function VerifyEmailForm(): JSX.Element {
return (
<AuthScene notes={notes}>
<AuthSceneCard
+ showPendingConnection
footer={
<p className="mt-5 mb-0 text-sm text-secondary text-center">
Wrong address?{' '}
diff --git a/frontend/src/scenes/authentication/verify-email/verifyEmailLogic.ts b/frontend/src/scenes/authentication/verify-email/verifyEmailLogic.ts
index eb02fc569766..b7e42b650dbb 100644
--- a/frontend/src/scenes/authentication/verify-email/verifyEmailLogic.ts
+++ b/frontend/src/scenes/authentication/verify-email/verifyEmailLogic.ts
@@ -17,7 +17,7 @@ import { userLogic } from 'scenes/userLogic'
import type { UserType } from '../../../types'
-// Must stay in sync with the `VerifyEmail__Progress` animation duration in VerifyEmail.scss.
+// The success screen's `AuthScene__progress` bar (AuthScene.scss) runs a little longer, so the redirect lands before it fills.
export const VERIFY_EMAIL_REDIRECT_DELAY_MS = 2000
type PostVerifyResponse = {
diff --git a/frontend/src/scenes/code-canvas/CodeChannelLink.tsx b/frontend/src/scenes/code-canvas/CodeChannelLink.tsx
index e4f9ad0ccaee..551484dbb978 100644
--- a/frontend/src/scenes/code-canvas/CodeChannelLink.tsx
+++ b/frontend/src/scenes/code-canvas/CodeChannelLink.tsx
@@ -2,12 +2,11 @@ import { useValues } from 'kea'
import { router } from 'kea-router'
import { useEffect } from 'react'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
-import { DesktopBridgeBody } from './DesktopBridgeBody'
+import { DesktopBridgePage } from './DesktopBridgePage'
import { DESKTOP_SCHEME } from './desktopScheme'
import { webPath } from './webPath'
@@ -54,11 +53,7 @@ export function CodeChannelLink({ channelId, taskId }: CodeChannelLinkProps): JS
}
}, [deepLink])
- return (
- <BridgePage view="code-channel-link">
- <DesktopBridgeBody subject={`This ${target}`} deepLink={deepLink} webUrl={webUrl} />
- </BridgePage>
- )
+ return <DesktopBridgePage subject={`This ${target}`} deepLink={deepLink} webUrl={webUrl} />
}
export default CodeChannelLink
diff --git a/frontend/src/scenes/code-canvas/CodeLoopLink.tsx b/frontend/src/scenes/code-canvas/CodeLoopLink.tsx
index 1ba855e1bb54..c47b995aee2d 100644
--- a/frontend/src/scenes/code-canvas/CodeLoopLink.tsx
+++ b/frontend/src/scenes/code-canvas/CodeLoopLink.tsx
@@ -1,9 +1,8 @@
import { useEffect } from 'react'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import { SceneExport } from 'scenes/sceneTypes'
-import { DesktopBridgeBody } from './DesktopBridgeBody'
+import { DesktopBridgePage } from './DesktopBridgePage'
import { DESKTOP_SCHEME } from './desktopScheme'
export interface CodeLoopLinkProps {
@@ -39,11 +38,7 @@ export function CodeLoopLink({ loopId }: CodeLoopLinkProps): JSX.Element {
}
}, [deepLink])
- return (
- <BridgePage view="code-loop-link">
- <DesktopBridgeBody subject="This loop" deepLink={deepLink} />
- </BridgePage>
- )
+ return <DesktopBridgePage subject="This loop" deepLink={deepLink} />
}
export default CodeLoopLink
diff --git a/frontend/src/scenes/code-canvas/CodeTaskLink.tsx b/frontend/src/scenes/code-canvas/CodeTaskLink.tsx
index 890777b968cc..8a319636bdeb 100644
--- a/frontend/src/scenes/code-canvas/CodeTaskLink.tsx
+++ b/frontend/src/scenes/code-canvas/CodeTaskLink.tsx
@@ -2,10 +2,9 @@ import { useValues } from 'kea'
import { router } from 'kea-router'
import { useEffect } from 'react'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import { SceneExport } from 'scenes/sceneTypes'
-import { DesktopBridgeBody } from './DesktopBridgeBody'
+import { DesktopBridgePage } from './DesktopBridgePage'
import { DESKTOP_SCHEME } from './desktopScheme'
export interface CodeTaskLinkProps {
@@ -44,11 +43,7 @@ export function CodeTaskLink({ taskId }: CodeTaskLinkProps): JSX.Element {
}
}, [deepLink])
- return (
- <BridgePage view="code-task-link">
- <DesktopBridgeBody subject="This task" deepLink={deepLink} />
- </BridgePage>
- )
+ return <DesktopBridgePage subject="This task" deepLink={deepLink} />
}
export default CodeTaskLink
diff --git a/frontend/src/scenes/code-canvas/DesktopBridgeBody.tsx b/frontend/src/scenes/code-canvas/DesktopBridgeBody.tsx
deleted file mode 100644
index 95d3830f12cc..000000000000
--- a/frontend/src/scenes/code-canvas/DesktopBridgeBody.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { IconLaptop } from '@posthog/icons'
-
-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
-import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { Link } from 'lib/lemon-ui/Link'
-
-import { desktopBridgeDescription, openInDesktop } from './desktopBridge'
-import { QuillDesktopBridgeBody } from './QuillDesktopBridgeBody'
-
-export interface DesktopBridgeBodyProps {
- /** What the interstitial is opening, e.g. "This canvas", "This task". Starts the explanatory sentence. */
- subject: string
- /** The `posthog-code(-dev)://…` URL to open, or null while its id isn't resolved yet. */
- deepLink: string | null
- /** The same item in the web app, for visitors who would rather not use the desktop app. Null when it has no web view. */
- webUrl?: string | null
-}
-
-/**
- * Shared body for the desktop-app bridge scenes (canvas/channel/task/loop links): an explanation,
- * a manual "open" button (in case the browser blocks the auto-redirect the scene fires on mount),
- * an "open in browser" button when the item also has a web view, and a download link for visitors without the app.
- */
-export function DesktopBridgeBody({ subject, deepLink, webUrl }: DesktopBridgeBodyProps): JSX.Element {
- const todayRailNav = useFeatureFlag('TODAY_RAIL_NAV')
- if (todayRailNav) {
- return <QuillDesktopBridgeBody subject={subject} deepLink={deepLink} webUrl={webUrl} />
- }
- return (
- <div className="flex flex-col items-center gap-4 text-center max-w-lg mx-auto">
- <IconLaptop className="text-5xl shrink-0" />
- <h2 className="text-xl font-semibold m-0">Opening in PostHog Desktop…</h2>
- <p className="text-muted mb-0">{desktopBridgeDescription(subject, !!webUrl)}</p>
- <div className="flex flex-wrap justify-center gap-2">
- {deepLink && (
- <LemonButton type="primary" onClick={() => openInDesktop(deepLink)}>
- Open in desktop app
- </LemonButton>
- )}
- {webUrl && (
- <LemonButton type="secondary" to={webUrl} data-attr="desktop-bridge-open-in-browser">
- Open in browser
- </LemonButton>
- )}
- </div>
- <Link to="https://posthog.com/desktop" target="_blank">
- Download PostHog Desktop
- </Link>
- </div>
- )
-}
diff --git a/frontend/src/scenes/code-canvas/DesktopBridgePage.tsx b/frontend/src/scenes/code-canvas/DesktopBridgePage.tsx
new file mode 100644
index 000000000000..0ee54501ada4
--- /dev/null
+++ b/frontend/src/scenes/code-canvas/DesktopBridgePage.tsx
@@ -0,0 +1,70 @@
+import { IconLaptop } from '@posthog/icons'
+
+import { LemonButton } from 'lib/lemon-ui/LemonButton'
+import { Link } from 'lib/lemon-ui/Link'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
+
+import { desktopBridgeDescription, openInDesktop } from './desktopBridge'
+
+export interface DesktopBridgePageProps {
+ /** What the interstitial is opening, e.g. "This canvas", "This task". Starts the explanatory sentence. */
+ subject: string
+ /** The `posthog-code(-dev)://…` URL to open, or null while its id isn't resolved yet. */
+ deepLink: string | null
+ /** The same item in the web app, for visitors who would rather not use the desktop app. Null when it has no web view. */
+ webUrl?: string | null
+}
+
+/**
+ * Shared page for the desktop-app bridge scenes (channel/task/loop links): an explanation, a manual
+ * "open" button (in case the browser blocks the auto-redirect the scene fires on mount), an "open in
+ * browser" button when the item also has a web view, and a download link for visitors without the app.
+ */
+export function DesktopBridgePage({ subject, deepLink, webUrl }: DesktopBridgePageProps): JSX.Element {
+ return (
+ <AuthScene notes={AUTH_NOTES.desktopBridge.default}>
+ <AuthSceneCard>
+ <div className="flex justify-center mb-3">
+ <IconLaptop className="text-5xl" />
+ </div>
+ <AuthCardTitle title="Opening in PostHog Desktop…" sub={desktopBridgeDescription(subject, !!webUrl)} />
+ <div className="flex flex-col gap-2">
+ {deepLink && (
+ <LemonButton
+ type="primary"
+ size="large"
+ fullWidth
+ center
+ onClick={() => openInDesktop(deepLink)}
+ >
+ Open in desktop app
+ </LemonButton>
+ )}
+ {webUrl && (
+ <LemonButton
+ type="secondary"
+ size="large"
+ fullWidth
+ center
+ to={webUrl}
+ data-attr="desktop-bridge-open-in-browser"
+ >
+ Open in browser
+ </LemonButton>
+ )}
+ </div>
+ <p className="mt-4 mb-0 text-sm text-center">
+ <Link
+ to="https://posthog.com/desktop"
+ target="_blank"
+ className="font-semibold no-underline cursor-pointer hover:underline hover:underline-offset-2 text-warning"
+ >
+ Download PostHog Desktop
+ </Link>
+ </p>
+ </AuthSceneCard>
+ </AuthScene>
+ )
+}
diff --git a/frontend/src/scenes/code-canvas/QuillDesktopBridgeBody.tsx b/frontend/src/scenes/code-canvas/QuillDesktopBridgeBody.tsx
deleted file mode 100644
index 08164f118939..000000000000
--- a/frontend/src/scenes/code-canvas/QuillDesktopBridgeBody.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { IconLaptop } from '@posthog/icons'
-import { Button, Heading, Text } from '@posthog/quill'
-
-import { LinkPrimitive } from 'lib/lemon-ui/Link'
-
-import { desktopBridgeDescription, openInDesktop } from './desktopBridge'
-import type { DesktopBridgeBodyProps } from './DesktopBridgeBody'
-
-/** The quill view of `DesktopBridgeBody`, for visitors on the `today-rail-nav` redesign. */
-export function QuillDesktopBridgeBody({ subject, deepLink, webUrl }: DesktopBridgeBodyProps): JSX.Element {
- return (
- <div data-quill className="flex flex-col items-center gap-4 text-center max-w-lg mx-auto">
- <IconLaptop className="text-5xl shrink-0" />
- <div className="flex flex-col gap-2">
- <Heading size="xl" render={<h2 className="m-0" />}>
- Opening in PostHog Desktop…
- </Heading>
- <Text size="xs" variant="muted" render={<p className="m-0" />}>
- {desktopBridgeDescription(subject, !!webUrl)}
- </Text>
- </div>
- <div className="flex flex-wrap justify-center gap-2">
- {deepLink && (
- <Button elevated variant="primary" size="lg" onClick={() => openInDesktop(deepLink)}>
- Open in desktop app
- </Button>
- )}
- {webUrl && (
- <Button
- elevated
- variant="outline"
- size="lg"
- render={<LinkPrimitive to={webUrl} />}
- data-attr="desktop-bridge-open-in-browser"
- >
- Open in browser
- </Button>
- )}
- </div>
- <Button variant="link" render={<LinkPrimitive to="https://posthog.com/desktop" target="_blank" />}>
- Download PostHog Desktop
- </Button>
- </div>
- )
-}
diff --git a/frontend/src/scenes/organization/ConfirmOrganization/ConfirmOrganization.tsx b/frontend/src/scenes/organization/ConfirmOrganization/ConfirmOrganization.tsx
index ac02a024264b..5d4618fc9d65 100644
--- a/frontend/src/scenes/organization/ConfirmOrganization/ConfirmOrganization.tsx
+++ b/frontend/src/scenes/organization/ConfirmOrganization/ConfirmOrganization.tsx
@@ -3,15 +3,16 @@ import { Form } from 'kea-forms'
import { Link } from '@posthog/lemon-ui'
-import { AnimatedCollapsible } from 'lib/components/AnimatedCollapsible'
-import { BridgePage } from 'lib/components/BridgePage/BridgePage'
import SignupReferralSource from 'lib/components/SignupReferralSource'
import SignupRoleSelect from 'lib/components/SignupRoleSelect'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { LemonDivider } from 'lib/lemon-ui/LemonDivider'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonInput } from 'lib/lemon-ui/LemonInput/LemonInput'
-import { OtherRegionHint } from 'scenes/authentication/shared/OtherRegionHint'
+import { OtherRegionNotice } from 'scenes/authentication/auth/components/OtherRegionNotice'
+import { AuthBanner } from 'scenes/authentication/shared/authScene/AuthBanner'
+import { AuthCardTitle } from 'scenes/authentication/shared/authScene/AuthCardTitle'
+import { AUTH_NOTES } from 'scenes/authentication/shared/authScene/authNotes'
+import { AuthScene, AuthSceneCard } from 'scenes/authentication/shared/authScene/AuthScene'
import { organizationLogic } from 'scenes/organizationLogic'
import { SceneExport } from 'scenes/sceneTypes'
@@ -26,99 +27,98 @@ export function ConfirmOrganization(): JSX.Element {
const { isConfirmOrganizationSubmitting, email, showNewOrgWarning } = useValues(confirmOrganizationLogic)
const { setShowNewOrgWarning } = useActions(confirmOrganizationLogic)
- return (
- <BridgePage view="org-creation-confirmation">
- <h2>Create a new organization</h2>
- <OtherRegionHint />
- <div className="flex-1">
- <p className="text-center">
- <strong>
- Trying to join an existing organization? <br />
- {!showNewOrgWarning && (
- <Link
- onClick={() => {
- setShowNewOrgWarning(true)
- }}
- >
- Read more
- </Link>
- )}
- </strong>
- </p>
- <AnimatedCollapsible collapsed={!showNewOrgWarning}>
- <div className="py-2">
- <p>
- If you're trying to join an existing organization, you should not create a new one. Some
- reasons that you may accidentally end up here are:
- </p>
- <ul className="list-disc pl-4">
- <li>You're logging in with the wrong email address</li>
- <li>Your PostHog account is at a different URL</li>
- <li>You need an invitation from a colleague</li>
- </ul>
- </div>
- </AnimatedCollapsible>
- </div>
-
- <Form
- logic={confirmOrganizationLogic}
- formKey="confirmOrganization"
- enableFormOnSubmit
- className="deprecated-space-y-4"
- >
- <LemonField name="email" label="Email">
- <LemonInput className="ph-ignore-input" value={email} disabled />
- </LemonField>
-
- <LemonField name="first_name" label="Your name">
- <LemonInput className="ph-ignore-input" placeholder="Jane Doe" />
- </LemonField>
-
- <LemonField
- name="organization_name"
- label="Organization name"
- help="You can always rename your organization later"
- >
- <LemonInput className="ph-ignore-input" placeholder="Hogflix Movies" />
- </LemonField>
-
- <SignupRoleSelect />
- <SignupReferralSource disabled={isConfirmOrganizationSubmitting} />
-
- <LemonButton
- htmlType="submit"
- fullWidth
- center
- type="primary"
- loading={isConfirmOrganizationSubmitting}
- >
- Create organization
- </LemonButton>
- </Form>
-
- <div className="text-center terms-and-conditions-text mt-4 text-secondary">
- By creating an account, you agree to our{' '}
+ const footer = (
+ <>
+ <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
</Link>{' '}
- and{' '}
+ <span>and</span>{' '}
<Link to="https://posthog.com/privacy" target="_blank">
Privacy Policy
</Link>
- .
- </div>
- <LemonDivider thick dashed className="my-6" />
- <div className="text-center terms-and-conditions-text mt-4 text-secondary">
- Have questions?{' '}
+ <span>.</span>
+ </p>
+ <p className="AuthScene__terms mt-2 mb-0 text-xs leading-relaxed text-tertiary text-center">
+ <span>Have questions?</span>{' '}
<Link to="https://posthog.com/support" target="_blank">
Visit support
</Link>{' '}
- or{' '}
+ <span>or</span>{' '}
<Link to="https://posthog.com/docs" target="_blank">
read our documentation
</Link>
- .
- </div>
- </BridgePage>
+ <span>.</span>
+ </p>
+ </>
+ )
+
+ return (
+ <AuthScene notes={AUTH_NOTES.confirmOrganization.default}>
+ <AuthSceneCard footer={footer} showPendingConnection>
+ <AuthCardTitle title="Create a new organization" sub="Your own corner of PostHog." />
+ <Form
+ logic={confirmOrganizationLogic}
+ formKey="confirmOrganization"
+ enableFormOnSubmit
+ className="flex flex-col gap-4"
+ >
+ <LemonField name="email" label="Email">
+ <LemonInput className="ph-ignore-input" value={email} disabled fullWidth />
+ </LemonField>
+
+ <LemonField name="first_name" label="Your name">
+ <LemonInput className="ph-ignore-input" placeholder="Jane Doe" fullWidth />
+ </LemonField>
+
+ <LemonField
+ name="organization_name"
+ label="Organization name"
+ help="You can always rename your organization later"
+ >
+ <LemonInput className="ph-ignore-input" placeholder="Hogflix Movies" fullWidth />
+ </LemonField>
+
+ <SignupRoleSelect />
+ <SignupReferralSource disabled={isConfirmOrganizationSubmitting} />
+
+ <LemonButton
+ htmlType="submit"
+ fullWidth
+ center
+ size="large"
+ type="primary"
+ loading={isConfirmOrganizationSubmitting}
+ >
+ Create organization
+ </LemonButton>
+ {email && <OtherRegionNotice email={email} reason="no_account" />}
+ </Form>
+ <div className="mt-4 text-center">
+ <button
+ type="button"
+ data-attr="confirm-organization-join-existing"
+ className="font-semibold no-underline cursor-pointer hover:underline hover:underline-offset-2 text-secondary text-xs"
+ onClick={() => setShowNewOrgWarning(!showNewOrgWarning)}
+ >
+ Trying to join an existing organization?
+ </button>
+ {showNewOrgWarning && (
+ <AuthBanner variant="note" className="mt-3">
+ <p className="m-0 mb-1.5">
+ If you're trying to join an existing organization, you should not create a new one. You
+ may have ended up here because:
+ </p>
+ <ul className="m-0 pl-4 list-disc">
+ <li>You're logging in with the wrong email address</li>
+ <li>Your PostHog account is at a different URL</li>
+ <li>You need an invitation from a colleague</li>
+ </ul>
+ </AuthBanner>
+ )}
+ </div>
+ </AuthSceneCard>
+ </AuthScene>
)
}
diff --git a/frontend/src/scenes/scenes.ts b/frontend/src/scenes/scenes.ts
index 4ab9f7998a98..580d4765ea81 100644
--- a/frontend/src/scenes/scenes.ts
+++ b/frontend/src/scenes/scenes.ts
@@ -543,11 +543,11 @@ export const sceneConfigurations: Record<Scene | string, SceneConfig> = {
description: 'Drop events at ingestion time based on event metadata.',
iconType: 'data_pipeline',
},
- [Scene.Unsubscribe]: { allowUnauthenticated: true, layout: 'app-raw' },
+ [Scene.Unsubscribe]: { allowUnauthenticated: true, layout: 'plain' },
[Scene.CodeCanvasLink]: { allowUnauthenticated: true, layout: 'app-raw' },
- [Scene.CodeChannelLink]: { allowUnauthenticated: true, layout: 'app-raw' },
- [Scene.CodeTaskLink]: { allowUnauthenticated: true, layout: 'app-raw' },
- [Scene.CodeLoopLink]: { allowUnauthenticated: true, layout: 'app-raw' },
+ [Scene.CodeChannelLink]: { allowUnauthenticated: true, layout: 'plain' },
+ [Scene.CodeTaskLink]: { allowUnauthenticated: true, layout: 'plain' },
+ [Scene.CodeLoopLink]: { allowUnauthenticated: true, layout: 'plain' },
[Scene.VerifyEmail]: { allowUnauthenticated: true, layout: 'plain' },
[Scene.WebAnalyticsPageReports]: {
projectBased: true,