From f52054e5e26d4ab6581b730d2f20de5157bf698c Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Wed, 1 Jul 2026 21:13:04 +0000 Subject: [PATCH] Fix auth calls to use central auth routes AuthGate was calling /cashup/api/auth/verify and /cashup/api/auth/login, which hit the cashup backend (404). Should call /api/auth/* which NPM routes to the central auth service, matching all other apps. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/AuthGate.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/AuthGate.tsx b/frontend/src/components/AuthGate.tsx index 8929ae3..e624df4 100644 --- a/frontend/src/components/AuthGate.tsx +++ b/frontend/src/components/AuthGate.tsx @@ -25,7 +25,7 @@ export function AuthGate({ children }: Props) { const [loading, setLoading] = useState(false) useEffect(() => { - fetch('/cashup/api/auth/verify?app=cashup', { credentials: 'include' }) + fetch('/api/auth/verify?app=cashup', { credentials: 'include' }) .then(async r => { if (r.ok) { setUser(await r.json()); setState('authed') } else setState('login') @@ -38,13 +38,13 @@ export function AuthGate({ children }: Props) { setLoading(true) setError('') try { - const res = await fetch('/cashup/api/auth/login', { + const res = await fetch('/api/auth/login', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, password }), }) if (!res.ok) { setError('Invalid email or password'); return } - const verify = await fetch('/cashup/api/auth/verify?app=cashup', { credentials: 'include' }) + const verify = await fetch('/api/auth/verify?app=cashup', { credentials: 'include' }) if (verify.ok) { setUser(await verify.json()); setState('authed') } else setError("You don't have access to this app.") } catch {