{"record":{"id":"c7df6c831d87d855","repo":"nextauthjs/next-auth","slug":"token-type-is-bearer-redundant-workaround-plea","errorCode":null,"errorMessage":"token_type is 'bearer'. Redundant workaround, please open an issue.","messagePattern":"token_type is 'bearer'\\. Redundant workaround, please open an issue\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/core/src/providers/wechat.ts","lineNumber":110,"sourceCode":"      url:\n        platformType === \"OfficialAccount\"\n          ? \"https://open.weixin.qq.com/connect/oauth2/authorize\"\n          : \"https://open.weixin.qq.com/connect/qrconnect\",\n      params: {\n        appid: clientId,\n        scope:\n          platformType === \"OfficialAccount\"\n            ? \"snsapi_userinfo\"\n            : \"snsapi_login\",\n      },\n    },\n    token: {\n      url: \"https://api.weixin.qq.com/sns/oauth2/access_token\",\n      params: { appid: clientId, secret: clientSecret },\n      async conform(response) {\n        const data = await response.json()\n        if (data.token_type === \"bearer\") {\n          console.warn(\n            \"token_type is 'bearer'. Redundant workaround, please open an issue.\"\n          )\n          return response\n        }\n        return Response.json({ ...data, token_type: \"bearer\" }, response)\n      },\n    },\n    userinfo: {\n      url: \"https://api.weixin.qq.com/sns/userinfo\",\n      async request({ tokens, provider }) {\n        if (!provider.userinfo) return\n\n        const url = new URL(provider.userinfo.url)\n        url.searchParams.set(\"access_token\", tokens.access_token!)\n        url.searchParams.set(\"openid\", String(tokens.openid))\n        url.searchParams.set(\"lang\", \"zh_CN\")\n        const response = await fetch(url)\n        return response.json()","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/nextauthjs/next-auth/blob/a1a16a5a7780488c7449feece410033f445d0b31/packages/core/src/providers/wechat.ts#L92-L128","documentation":"The WeChat provider's token endpoint conform() rewrites token_type to 'bearer' because WeChat returns a nonstandard value. This console.warn fires when WeChat's response already has token_type === 'bearer', meaning the normalization workaround is no longer needed. The provider author asks users to report it so the workaround can be removed.","triggerScenarios":"Exchanging a WeChat OAuth code via https://api.weixin.qq.com/sns/oauth2/access_token when the API response includes token_type === 'bearer' (instead of the historically lowercase/missing value the workaround targets).","commonSituations":"WeChat changing their OAuth API response format; new WeChat app types that already comply with the OAuth spec; developers noticing the warning after upgrading the SDK while the underlying API updated.","solutions":["No action required — the response is passed through unchanged and sign-in works","Verify the OAuth flow completes and token_type is consumed correctly by your provider chain","Report the change to the Auth.js maintainers (open an issue) so the WeChat conform() workaround can be dropped"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ignore this warning — it is informational and the flow succeeds","Pin provider/SDK versions and read changelogs for WeChat API changes","Track upstream issues so you can remove reliance on the workaround when fixed"],"tags":["oauth","wechat","provider","deprecation"],"backgroundTag":"provider-token-type-workaround","analyzedSha":"a1a16a5a7780488c7449feece410033f445d0b31","analyzedAt":"2026-08-28T21:52:38.200Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}