From 0cdea55f16430b54b57d3e5b23e4b57ce1ed0c8f Mon Sep 17 00:00:00 2001 From: CartSnitch Engineer Bot Date: Fri, 3 Apr 2026 09:45:45 +0000 Subject: [PATCH 1/2] feat(frontend): show email-in address on Settings page with copy button Co-Authored-By: Paperclip --- src/pages/Settings.tsx | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 5ad0382..36b56e2 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -1,3 +1,4 @@ +import { useState, useEffect } from 'react' import { Link, useNavigate } from 'react-router-dom' import { authClient } from '../lib/auth-client.ts' import { useAuthStore } from '../stores/auth.ts' @@ -9,6 +10,26 @@ export function Settings() { const setAuthenticated = useAuthStore((s) => s.setAuthenticated) const navigate = useNavigate() const { theme, setTheme } = useThemeStore() + const [emailInAddress, setEmailInAddress] = useState(null) + const [copied, setCopied] = useState(false) + + useEffect(() => { + if (!session?.user) return + fetch('/api/me/email-in-address', { + credentials: 'include', + }) + .then((res) => res.json()) + .then((data) => setEmailInAddress(data.email_address)) + .catch(() => setEmailInAddress(null)) + }, [session]) + + async function handleCopyEmail() { + if (emailInAddress) { + await navigator.clipboard.writeText(emailInAddress) + setCopied(true) + setTimeout(() => setCopied(false), 2000) + } + } const user = session?.user const connectedStores: string[] = [] @@ -113,6 +134,30 @@ export function Settings() { + + {/* Receipt Email section */} +
+

Receipt Email

+
+

+ Forward your digital receipt emails to this address: +

+
+ + {emailInAddress ?? 'Loading...'} + + +
+

+ Supports Meijer, Kroger, and Target receipt emails. +

+
+
) } From c955ddbf10f701b7e5440203db07b9af2c9f1675 Mon Sep 17 00:00:00 2001 From: CartSnitch Engineer Bot Date: Fri, 3 Apr 2026 10:32:25 +0000 Subject: [PATCH 2/2] fix(frontend): correct email-in-address fetch URL to /auth prefix Co-Authored-By: Paperclip --- src/pages/Settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 36b56e2..81fcb5e 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -15,7 +15,7 @@ export function Settings() { useEffect(() => { if (!session?.user) return - fetch('/api/me/email-in-address', { + fetch('/auth/me/email-in-address', { credentials: 'include', }) .then((res) => res.json())