MEDIUM AI PREVALENCE: MEDIUM auth.nextauth.debug-enabled
The NextAuth/Auth.js config hard-codes debug: true.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
Debug mode writes verbose diagnostics, including provider responses and token material, to the server logs, and leaving it on in production leaks that data to anyone who can read the logs. Gate it on the environment instead, for example debug: process.env.NODE_ENV !== 'production', or remove the flag so it defaults to off.
VULNERABLE
SAFE
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.nextauth.debug-enabled -- <reason>