nextauthjs/next-auth

Bungie Provider and Typescript / Does this provider even work?

开放

#6,930 创建于 2023年3月12日

 (13 条评论) (0 个反应) (0 位负责人)TypeScript (2,632 个派生)batch import
buggood first issuehelp-neededproviders

仓库指标

星标
 (20,875 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Question 💬

I followed the example for adding the Bungie provider here. After doing so I found that the default implementation isn't happy with Typescript.

Argument of type '{ clientId: string; clientSecret: string; headers: { "X-API-Key": string; }; }' is not assignable to parameter of type 'Partial<OAuthConfig<any>>'. Object literal may only specify known properties, and 'headers' does not exist in type 'Partial<OAuthConfig<any>>'.

What is the intended setup when using Typescript with this provider?

How to reproduce ☕️

  1. Create a typescript application using create t3 app
  2. Select nextAuth and Typescript at least
  3. Go to the src/server/auth.ts file
  4. Locate the provider section
  5. Copy/Paste default provider implementation from provider docs

Contributing 🙌🏽

No, I am afraid I cannot help regarding this.

Unless it is as simple as changing the default to this:

BungieProvider({
      clientId: env.BUNGIE_CLIENT_ID,
      clientSecret: env.BUNGIE_SECRET,
      httpOptions: {
        headers: {
          "X-API-Key": env.BUNGIE_API_KEY
        }
      }
    }),

贡献者指南