{"record":{"id":"151e82bf98e1b60d","repo":"nextauthjs/next-auth","slug":"scope-is-a-string-redundant-workaround-please","errorCode":null,"errorMessage":"'scope' is a string. Redundant workaround, please open an issue.","messagePattern":"'scope' is a string\\. Redundant workaround, please open an issue\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/core/src/providers/twitch.ts","lineNumber":94,"sourceCode":"    issuer: \"https://id.twitch.tv/oauth2\",\n    id: \"twitch\",\n    name: \"Twitch\",\n    type: \"oidc\",\n    client: { token_endpoint_auth_method: \"client_secret_post\" },\n    authorization: {\n      params: {\n        scope: \"openid user:read:email\",\n        claims: {\n          id_token: { email: null, picture: null, preferred_username: null },\n        },\n      },\n    },\n    token: {\n      async conform(response) {\n        const body = await response.json()\n        if (response.ok) {\n          if (typeof body.scope === \"string\") {\n            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(","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/nextauthjs/next-auth/blob/a1a16a5a7780488c7449feece410033f445d0b31/packages/core/src/providers/twitch.ts#L76-L112","documentation":"Twitch returns its token endpoint `scope` field as a space-delimited string, but NextAuth's provider includes a `conform` workaround that handles the case where it is an array, joining it into a string. This console.warn fires when Twitch already returns a string, making the normalization workaround unnecessary; the library asks you to report it so the workaround can be removed. It is informational and does not break the flow.","triggerScenarios":"Any successful Twitch OAuth token exchange where the response body's `scope` field is already a string (Twitch's normal behavior), hitting the `typeof body.scope === \"string\"` branch in token.conform.","commonSituations":"Standard Twitch sign-in with recent Twitch API versions that return scope as a string; developers seeing the warning while debugging provider token responses.","solutions":["Ignore the warning — it is harmless and the token flow continues normally","Open an issue with the NextAuth.js/Auth.js repo per the message so the redundant workaround can be removed","Upgrade to a newer adapter/authjs version where the Twitch workaround may already be removed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const body = await response.json()\nif (body && typeof body.scope === \"string\") {\n  // already normalized; no workaround needed\n}","typeGuard":"function scopeIsString(v: unknown): v is string {\n  return typeof v === \"string\"\n}","tryCatchPattern":null,"preventionTips":["Treat this warning as informational; verify sign-in still completes","Check the Twitch token response shape for your API version","Keep authjs packages updated so removed workarounds stop warning","Report occurrences upstream as the message requests"],"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"}