nextauthjs/next-auth

Bungie Provider and Typescript / Does this provider even work?

Open

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

在 GitHub 查看
 (13 评论) (0 反应) (0 负责人)TypeScript (20,875 star) (2,632 fork)batch import
buggood first issuehelp-neededproviders

描述

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
        }
      }
    }),

贡献者指南