title: Client_fetch_error session ConnRefused (next-auth v3)
body: <p>First I am trying to run the production build on my local machine that is why I am still using localhost:3000 for next url. I get the following error in the terminal: <a href="https://next-auth.js.org/errors#client_fetch_error" rel="nofollow noreferrer">https://next-auth.js.org/errors#client_fetch_error</a> session FetchError: request to http://localhost:3000/api/auth/session failed, reason: connect ECONNREFUSED ::1:3000</p>
  <p>so it is giving me a connection refused just for the session when i run in dev mode the code works and the session is created. here is my [...nextauth].js api page.</p>
  <pre><code>import NextAuth from &quot;next-auth&quot;;
  import Providers from &quot;next-auth/providers&quot;;
  import { connectDatabase } from &quot;../../../helpers/db-util&quot;;
  import { verifyPasswd } from &quot;../../../helpers/api-util&quot;;
  
  export default NextAuth({
    session: {
      jwt: true,
    },
    providers: [
      Providers.Credentials({
        async authorize(credentials) {
          const client = await connectDatabase();
  
          const usersCollection = client.db().collection(&quot;members&quot;);
          
         
          const user = await usersCollection.findOne({
            memberId: credentials.memberNumber
          });
          console.log(user)
          if (!user) {
            client.close();
            throw new Error(&quot;No User Found&quot;);
          }
          const isValid = await verifyPasswd(credentials.password, user.password);
  
          if (!isValid) {
            client.close();
            throw new Error(&quot;Invalid Password&quot;);
          }
          client.close();
          // =================================================================
          // I might have to store the data for the token above the client.close() method
          // if so will store an object.
          //================================================================
          return {
            name: user.memberId,
            email: user.email
            
          };
        },
      }),
    ],
  });
  </code></pre>
  <p>The connection to the mongo data base to look up the user works fine.
  could really use some help on this one.</p>