mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
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:
@@ -164,7 +164,10 @@ export default function App() {
|
|||||||
return
|
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) {
|
if (r.status === 404) {
|
||||||
const body = await r.json().catch(() => ({} as { status?: string }))
|
const body = await r.json().catch(() => ({} as { status?: string }))
|
||||||
setGenerateError(body.status === 'not_found' ? 'User not found' : 'Not enrolled')
|
setGenerateError(body.status === 'not_found' ? 'User not found' : 'Not enrolled')
|
||||||
|
|||||||
Reference in New Issue
Block a user