title: Type 'Session' is not assignable to type 'Record<string, unknown>'
body: <p>I am trying to implement the callback of <a href="https://next-auth.js.org/configuration/callbacks#session-callback" rel="nofollow noreferrer">https://next-auth.js.org/configuration/callbacks#session-callback</a>. The <code>sesssion</code> callback is defined as follows:</p>
  <pre><code>export interface CallbacksOptions {
      session?:
          | ((session: Session) =&gt; WithAdditionalParams&lt;Session&gt;)
          | ((session: Session, userOrToken: User | JWT) =&gt; Promise&lt;WithAdditionalParams&lt;Session&gt;&gt;);
  }
  </code></pre>
  <p>The implementation of the <code>session</code> callback:</p>
  <pre><code>   async session(session: Session, token: JWT) {
  
          if (token?.accessToken) {
              session.user.accessToken = token.accessToken;
              session.accessToken = token.accessToken as string;
          }
  
          if (token?.provider) {
              session.user.provider = token.provider;
          }
  
          if (token?.accountId) {
              session.user.accountId = token.accountId;
          }
  
          return Promise.resolve&lt;WithAdditionalParams&lt;Session&gt;&gt;(session);
      }
  </code></pre>
  <p>The compiler complains:</p>
  <pre><code>TS2345: Argument of type 'Session' is not assignable to parameter of type 'WithAdditionalParams&lt;Session&gt; | PromiseLike&lt;WithAdditionalParams&lt;Session&gt;&gt;'.
    Type 'Session' is not assignable to type 'WithAdditionalParams&lt;Session&gt;'.
      Type 'Session' is not assignable to type 'Record&lt;string, unknown&gt;'.
        Index signature is missing in type 'Session'.
  </code></pre>
  <p>the <code>session</code> is defined as follows:</p>
  <pre><code>export interface Session {
      user: WithAdditionalParams&lt;User&gt;;
      accessToken?: string;
      expires: string;
  }
  
  export type WithAdditionalParams&lt;T extends Record&lt;string, any&gt;&gt; = T &amp; Record&lt;string, unknown&gt;;
  
  export interface User {
      name?: string | null;
      email?: string | null;
      image?: string | null;
  }
  
  </code></pre>
  <p>What am I doing wrong?
  The repo of next-auth is hosted on <a href="https://github.com/nextauthjs/next-auth" rel="nofollow noreferrer">https://github.com/nextauthjs/next-auth</a> and types <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/7c785c26527720bf726f8b8bcbab2f96c600d1a4/types/next-auth/index.d.ts" rel="nofollow noreferrer">https://github.com/DefinitelyTyped/DefinitelyTyped/blob/7c785c26527720bf726f8b8bcbab2f96c600d1a4/types/next-auth/index.d.ts</a></p>