fix: impersonation, dashboard counter, logo lightbox, submission config, auth logs
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m12s

- Fix impersonation by bypassing useSession().update() loading gate with direct session POST
- Fix dashboard account counter defaulting to latest round with PASSED projects
- Add clickToEnlarge lightbox for project logos on admin detail page
- Remove submission eligibility config (all passed projects must upload)
- Suppress CredentialsSignin auth errors in production (minified name check)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 15:40:08 +01:00
parent fd2624f198
commit b7905a82e1
10 changed files with 117 additions and 102 deletions

23
src/lib/session-update.ts Normal file
View File

@@ -0,0 +1,23 @@
/**
* Direct session update that bypasses useSession().update()'s `if (loading) return;` guard.
* This ensures the JWT cookie is always updated, even when another session refresh is in-flight.
*/
export async function directSessionUpdate(data: Record<string, unknown>): Promise<boolean> {
try {
// Get CSRF token
const csrfResp = await fetch('/api/auth/csrf')
if (!csrfResp.ok) return false
const { csrfToken } = await csrfResp.json()
// POST session update
const resp = await fetch('/api/auth/session', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ csrfToken, data }),
})
return resp.ok
} catch {
return false
}
}