title: issue with ldap login on next-auth
body: <p>I'm trying to build a signin mechanism using active directory and nextauth, i'm getting a type error which i'm unable to solve.  i'm attaching my [...nextauth.js] and error page below.</p>
  <pre><code>export default NextAuth({
    providers: [
      CredentialsProvider({
        name: &quot;LDAP&quot;,
        credentials: {
          username: { label: &quot;DN&quot;, type: &quot;text&quot;, placeholder: &quot;&quot; },
          password: { label: &quot;Password&quot;, type: &quot;password&quot; },
        },
        async authorize(credentials, req) {
          
          const client = ldap.createClient({
            url: process.env.LDAP_URI,
          })
   
          console.log(credentials)
          
          return new Promise((resolve, reject) =&gt; {
            client.bind(credentials.username, credentials.password, (error) =&gt; {
              if (error) {
                console.error(&quot;Failed&quot;)
                reject()
              } else {
                console.log(&quot;Logged in&quot;)
                resolve({
                  username: credentials.username,
                  password: credentials.password,
                })
              }
            })
          })
        },
      }),
    ],
    callbacks: {
      async jwt({ token, user }) {
        const isSignIn = user ? true : false
        if (isSignIn) {
          token.username = user.username
          token.password = user.password
        }
        return token
      },
      async session({ session, token }) {
        return { ...session, user: { username: token.username } }
      },
    },
    secret: process.env.NEXTAUTH_SECRET,
    jwt: {
      secret: process.env.JWT_SECRET,
    }
  })
  </code></pre>
  <p>My active directory is running on a windows server 2016 vm and the network have been bridged. I'm able to connect and browser the AD using ldap clients such as apache directory studio.</p>