{"record":{"id":"36c92a5defeb181b","repo":"nextauthjs/next-auth","slug":"response-has-error-redundant-workaround-please","errorCode":null,"errorMessage":"Response has 'error'. Redundant workaround, please open an issue.","messagePattern":"Response has 'error'\\. Redundant workaround, please open an issue\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/core/src/providers/twitch.ts","lineNumber":112,"sourceCode":"            console.warn(\n              \"'scope' is a string. Redundant workaround, please open an issue.\"\n            )\n          } else if (Array.isArray(body.scope)) {\n            body.scope = body.scope.join(\" \")\n            return new Response(JSON.stringify(body), response)\n          } else if (\"scope\" in body) {\n            delete body.scope\n            return new Response(JSON.stringify(body), response)\n          }\n        } else {\n          const { message: error_description, error } = body\n          if (typeof error !== \"string\") {\n            return new Response(\n              JSON.stringify({ error: \"invalid_request\", error_description }),\n              response\n            )\n          }\n          console.warn(\n            \"Response has 'error'. Redundant workaround, please open an issue.\"\n          )\n        }\n      },\n    },\n    style: { bg: \"#65459B\", text: \"#fff\" },\n    options: config,\n  }\n}\n","sourceCodeStart":94,"sourceCodeEnd":122,"githubUrl":"https://github.com/nextauthjs/next-auth/blob/a1a16a5a7780488c7449feece410033f445d0b31/packages/core/src/providers/twitch.ts#L94-L122","documentation":"Twitch's token endpoint can return an OAuth error body ({ error, error_description }), and this provider's `conform` function rewrites a malformed error response into a standard one. This warn fires when the parsed error is already a string, meaning the response already conforms to the OAuth spec and the workaround is redundant. Like the sibling warning, it asks you to report it so the workaround can be dropped. It does not interrupt the OAuth flow.","triggerScenarios":"A Twitch token request that fails (e.g. invalid code or client credentials) and returns a body whose `error` field is already a string, reaching the warn branch after the error_description handling.","commonSituations":"Debugging failed Twitch logins with expired authorization codes or mismatched client secret; seeing the warning alongside the actual OAuth error propagated to the sign-in callback.","solutions":["Ignore the warning — the OAuth error is still returned and handled upstream","Open an issue on the NextAuth.js/Auth.js repository noting the redundant workaround","Fix the underlying OAuth failure (verify TWITCH_CLIENT_ID/SECRET, redirect URI, and that the auth code is single-use and unexpired)"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const body = await response.json()\nif (\"error\" in body) {\n  const isOAuthError = typeof body.error === \"string\" && typeof body.error_description === \"string\"\n  // already spec-conformant; fix the OAuth failure instead of the warning\n}","typeGuard":"function isOAuthErrorBody(b: any): b is { error: string; error_description?: string } {\n  return b && typeof b.error === \"string\"\n}","tryCatchPattern":null,"preventionTips":["Verify Twitch client id/secret and redirect URI before debugging the warning","Remember authorization codes are single-use and expire quickly","Check upstream CallbackRouteError to find the real OAuth failure","Keep provider code updated with authjs releases"],"tags":["oauth","twitch","console-warning"],"backgroundTag":"oauth-provider-response-shape-mismatch","analyzedSha":"a1a16a5a7780488c7449feece410033f445d0b31","analyzedAt":"2026-08-28T21:52:38.200Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}