fix(frontend): send cookies on /generate POST

Without credentials: 'include', the session cookie isn't attached and
the OAuth-guarded endpoint returns 401.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
shay
2026-04-19 20:10:14 -04:00
co-authored by Claude Opus 4.7
parent 9e837519cc
commit f9caa61c77
+4 -1
View File
@@ -164,7 +164,10 @@ export default function App() {
return
}
const r = await fetch(`/api/${encodeURIComponent(username)}/generate`, { method: 'POST' })
const r = await fetch(`/api/${encodeURIComponent(username)}/generate`, {
method: 'POST',
credentials: 'include',
})
if (r.status === 404) {
const body = await r.json().catch(() => ({} as { status?: string }))
setGenerateError(body.status === 'not_found' ? 'User not found' : 'Not enrolled')