From 56bb0bf72616ea063538e65d55978899ee53de6f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Feb 2026 20:44:08 +0000 Subject: [PATCH] Wire up anonymous feedback claiming on auth success MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After a user signs in or signs up (email or OAuth), call the merge-anonymous endpoint so any feedback or votes they submitted while anonymous are transferred to their account. - Login page: fire-and-forget merge after email sign-in success - Signup page: fire-and-forget merge after email sign-up success - Dashboard: fire-and-forget merge on mount to cover the OAuth redirect flow (no anon session → returns immediately, no cost) https://claude.ai/code/session_01To7EAUVXuzzwAPdHeovtFM --- TODO.md | 1 - pages/dashboard/index.vue | 4 ++++ pages/login/index.vue | 1 + pages/signup/index.vue | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 6de3dfe..668a28f 100644 --- a/TODO.md +++ b/TODO.md @@ -4,6 +4,5 @@ - Update color picker to use new design - click to access feedback details for items in personal feedback list - Notifications infrastructure -- Anonymous feedback claiming - Email verification nudge - Create widgets for users to embed on their website \ No newline at end of file diff --git a/pages/dashboard/index.vue b/pages/dashboard/index.vue index 221e39c..0268bd1 100644 --- a/pages/dashboard/index.vue +++ b/pages/dashboard/index.vue @@ -281,6 +281,10 @@ export default { try { this.isLoading = true + // Merge any anonymous feedback/votes into the authenticated account. + // This covers the OAuth redirect flow where login/signup pages aren't involved. + $fetch('/api/auth/merge-anonymous', { method: 'POST' }).catch(() => {}) + const [sessionResult, orgsResult] = await Promise.all([ authClient.useSession(useFetch), authClient.organization.list().catch(() => ({ data: [] })), diff --git a/pages/login/index.vue b/pages/login/index.vue index 48cc680..40e85ff 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -135,6 +135,7 @@ export default { if (result.error) { this.error = result.error.message || 'Sign in failed' } else { + $fetch('/api/auth/merge-anonymous', { method: 'POST' }).catch(() => {}) const redirect = this.$route.query.redirect await navigateTo(redirect && typeof redirect === 'string' && redirect.startsWith('/') ? redirect : '/dashboard') } diff --git a/pages/signup/index.vue b/pages/signup/index.vue index 7341590..294fe80 100644 --- a/pages/signup/index.vue +++ b/pages/signup/index.vue @@ -146,6 +146,7 @@ export default { if (result.error) { this.error = result.error.message || 'Sign up failed' } else { + $fetch('/api/auth/merge-anonymous', { method: 'POST' }).catch(() => {}) const redirect = this.$route.query.redirect await navigateTo(redirect && typeof redirect === 'string' && redirect.startsWith('/') ? redirect : '/dashboard') }