一键导入
nextauth-dev-implementation-debugging
Practical NextAuth/Auth.js development and implementation playbook with end-to-end debugging workflows for Next.js apps.
菜单
Practical NextAuth/Auth.js development and implementation playbook with end-to-end debugging workflows for Next.js apps.
| name | nextauth-dev-implementation-debugging |
| description | Practical NextAuth/Auth.js development and implementation playbook with end-to-end debugging workflows for Next.js apps. |
| category | auth |
| priority | high |
Build, verify, and debug NextAuth/Auth.js integrations with production-grade reliability.
This skill focuses on:
Use this skill when you need to:
auth.ts, providers, callbacks, or session behaviormiddleware/proxy + server checks)AUTH_SECRET, provider IDs/secrets)Checklist:
auth.ts export surface (handlers, auth, signIn, signOut).jwt: fewer DB reads, simpler edge supportdatabase: immediate revocation/sign-out-everywhere supportjwt, session, authorized).Checklist:
AUTH_SECRET exists and is stable per environmentProtect at two layers:
authorized/proxy guard)auth() or API guard)Checklist:
Use structured logs for key auth transitions:
Log fields:
correlationIdrouteprincipalId/email when safeerrorCodeportal, codeLength, hasToken)Checklist:
Create strict tests for:
ok/data vs ok/code/message)Recommended command:
pnpm -C apps/api exec vitest run src/__vitest_test__/auth-flows.test.ts
Inspired by NextAuth Cypress tutorial principles:
For local stability:
PLAYWRIGHT_BASE_URL when server already runningwaitUntil: "domcontentloaded" for auth page checksRecommended command:
$env:PLAYWRIGHT_BASE_URL='http://localhost:3900'; pnpm -C apps/web exec playwright test e2e/smoke.spec.ts --project=chromium
If Cypress is required:
cypress.env.jsonImportant: In modern Next.js/Auth.js projects, Playwright is generally the default E2E runner; keep Cypress only if your team standard requires it.
Checks:
auth() server session output with middleware/proxy auth stateAUTH_URL and app origin are alignedChecks:
authorized callback/middleware logic is not too broadjwt/session callbacksChecks:
redirect()Checks:
Checks:
@nextauth-authentication for baseline Auth.js setup patterns@vitest for test authoring and coverage@react-testing-patterns for UI auth state tests@next-best-practices for Next.js App Router patternsEnforces correct use of AFENDA design tokens, the L0–L4 premium elevation architecture, semantic lanes, and generous spatial rhythm. Use when editing styles, themes, layouts, or visual states.
Complete Neon Auth integration setup for AFENDA, addressing gaps in current codebase. Covers provisioning, server SDK, client SDK, bearer token verification, and security module integration.
Build AFENDA Treasury as an AP-grade full-stack ERP sub-domain (contracts, db, core, api, worker, web, tests, gates). Use when: treasury module, cash management, bank account, bank statement, reconciliation, liquidity forecast, cash position, payment factory, bank transfer, treasury controls, treasury architecture review, AP-style enterprise workflow.
Quality assurance for web accessibility and usability, particularly for users with disabilities. Use when involved in any web project.
Skill for integrating Better Auth - the comprehensive TypeScript authentication framework.
This skill provides guidance for implementing security features that span across Better Auth, including rate limiting, CSRF protection, session security, trusted origins, secret management, OAuth security, IP tracking, and security auditing. These topics are not covered in individual plugin skills.