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.

fix(auth): unverified-email banner CTA not sending verification email (#61235)

Matt Brooker0ec9af50e917
diff --git a/frontend/src/layout/navigation/projectNoticeLogic.test.ts b/frontend/src/layout/navigation/projectNoticeLogic.test.ts
index d90e7d158d72..f09182cdb6b6 100644
--- a/frontend/src/layout/navigation/projectNoticeLogic.test.ts
+++ b/frontend/src/layout/navigation/projectNoticeLogic.test.ts
@@ -2,6 +2,8 @@ import { MOCK_TEAM_ID } from 'lib/api.mock'
import { expectLogic } from 'kea-test-utils'
+import { verifyEmailLogic } from 'scenes/authentication/signup/verify-email/verifyEmailLogic'
+
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
import { AppContext } from '~/types'
@@ -65,4 +67,34 @@ describe('projectNoticeLogic', () => {
logic.unmount()
})
})
+
+ describe('unverified email banner CTA', () => {
+ beforeEach(() => {
+ useMocks({
+ get: {
+ '/api/organizations/@current/proxy_records': [200, { results: [] }],
+ },
+ post: {
+ '/api/users/request_email_verification/': [200, { success: true }],
+ },
+ })
+ initKeaTests()
+ })
+
+ it('mounts verifyEmailLogic so the CTA reaches its request loader', async () => {
+ const logic = projectNoticeLogic()
+ logic.mount()
+
+ // The banner renders on every scene, but verifyEmailLogic is otherwise only mounted on the
+ // verify-email scene — without this connection the CTA action dispatches into an unmounted
+ // logic and silently no-ops.
+ expect(verifyEmailLogic.isMounted()).toBe(true)
+
+ await expectLogic(verifyEmailLogic, () => {
+ verifyEmailLogic.actions.requestVerificationLink('test-uuid')
+ }).toDispatchActions(['requestVerificationLink', 'requestVerificationLinkSuccess'])
+
+ logic.unmount()
+ })
+ })
})
diff --git a/frontend/src/layout/navigation/projectNoticeLogic.tsx b/frontend/src/layout/navigation/projectNoticeLogic.tsx
index fd23f714022b..d2607f46d663 100644
--- a/frontend/src/layout/navigation/projectNoticeLogic.tsx
+++ b/frontend/src/layout/navigation/projectNoticeLogic.tsx
@@ -116,7 +116,14 @@ export const projectNoticeLogic = kea<projectNoticeLogicType>([
path(['layout', 'navigation', 'projectNoticeLogic']),
connect(() => ({
values: [membersLogic, ['memberCount'], organizationLogic, ['currentOrganizationId']],
- actions: [eventUsageLogic, ['reportProjectNoticeDismissed', 'reportProjectNoticeShown']],
+ actions: [
+ eventUsageLogic,
+ ['reportProjectNoticeDismissed', 'reportProjectNoticeShown'],
+ // Mount verifyEmailLogic so the "Send verification email" banner CTA's loader fires.
+ // The banner renders on every scene, but verifyEmailLogic is otherwise only mounted on the verify-email scene.
+ verifyEmailLogic,
+ ['requestVerificationLink'],
+ ],
})),
actions({
dismissProjectNotice: (dismissKey: string | null) => ({ dismissKey }),