/login, or two people can edit the same step. Related: Errors and rate limits, Environment variables, Role preview.
FAQ
Google sign-in returns to /login
Google sign-in returns to /login
- Email ends with
@schools.nyc.gov. - A
usersdocument exists for that lowercase email. isActiveis notfalse.- Google OAuth redirect URI matches the origin (
/api/auth/callback/google). NEXTAUTH_URLis that same origin (http://localhost:3000locally).
npm run seed-users. Demo mailboxes (d79.demo.*) cannot Google-sign-in — preview them from a Super Admin session.403 on GET /api/forms/:id/editors (form page still opens)
403 on GET /api/forms/:id/editors (form page still opens)
canViewForm in src/lib/formAccess.js. Same-school levels 2, 3, and 4 may read editors/locks and edit answers (one plan per school per year). Level 1 still needs an assignment or share.If you preview as Principal or AP on a plan at the demo school, editors should return 200. Preview as a viewer (level 1) without a share and expect 403 on write.Assistant Principal cannot create or attest
Assistant Principal cannot create or attest
canEditForm) but cannot create, duplicate, attest, or submit. Those stay level ≥ 4. See Roles and access.401 immediately after Sign out, or session lasts after logout
401 immediately after Sign out, or session lasts after logout
sess:deny:{jti} in Redis. Without REDIS_URL, the JWT cookie remains valid until the 8-hour maxAge. Set Redis in production.429 Too many requests
429 Too many requests
/admin/system → Redis, then Retry Redis.Autosave 409 or lock held by someone else
Autosave 409 or lock held by someone else
form:{id}:step:{stepKey}). Presence heartbeats last 60s. Two serverless instances without Redis cannot see each other’s locks — configure REDIS_URL. Closing the tab should POST .../step/:n/unlock.NEXTAUTH_SECRET is required / Preview build failed collecting page data
NEXTAUTH_SECRET is required / Preview build failed collecting page data
NEXTAUTH_SECRET at request time. Set it on Production and Preview. Copy .env.example to .env.local and run openssl rand -base64 32.This site is only available in New York
This site is only available in New York
GEO_RESTRICT=deny is on, or a WAF deny rule is live. HTML requests redirect to /unavailable. APIs return 403 JSON (This application is only available from New York State.). Allowed geo is US + NY state, not city = New York. Local hosts without Vercel geo headers are allowed. Leave GEO_RESTRICT unset until Firewall logs look clean.Production build fails on page.js exports
Production build fails on page.js exports
page.js. Only the default page export (plus reserved fields such as metadata) is allowed. Keep helpers as local functions or move them to src/components.Mongoose schema change not visible
Mongoose schema change not visible
npm run dev. The connection is cached on global.mongoose.Public homepage counts look stale
Public homepage counts look stale
GET /api/public/overview is cached 60s in Redis. Super Admin → System → Flush caches.Diagnose a 403
Confirm who the API thinks you are
level come from the JWT. During role preview they are the demo user, not your Super Admin mailbox.Compare with the form document
userId (owner), principalEmail, schoolName, assignedTo / collaborator assignedForms, sharedWithEmails.Match the handler
canViewForm / canEditForm: Super Admin, owner, matching principalEmail, or same-school levels 2–4. Level 1 and off-school users need assignedForms or sharedWithEmails. Attest/submit/create still require level ≥ 4.Local checklist
/admin/system should show MongoDB connected.
