Next.Js 14 : Token not getting passed to session callback (next-auth)

I’m using next-auth with prisma adapter to manage the authentication process,
however the session callback by default return a session with only some fields so the expected action to pass any additional info is to pass it through the token callback to the session callback then return the required session with additional info
My Problem is that I’m unable to access the token object in the session callback to add the extra info to the session and the token is always ‘undefined‘ in the session callback
here is my next-auth config

import NextAuth from "next-auth"
import CredentialsProvider from "next-auth/providers/credentials"
import bcrypt from "bcrypt"
import { PrismaAdapter } from "@auth/prisma-adapter"
import jwt from 'jsonwebtoken';
import prisma from "@/utils/prisma"


export const authOptions = {
  adapter: PrismaAdapter(prisma),
  providers: [
    CredentialsProvider({
      name: "credentials",
      credentials: {
        email: { label: 'Email', type: 'text' },
        password: { label: 'Password', type: 'password' }
      },
      async authorize(credentials) {
        if (!credentials.email || !credentials.password) {
          return null
        }
        const user = await prisma.user.findUnique({
          where: {
            email: credentials.email
          }
        })
        if (!user) {
          return null
        }
        const passwordMatch = await bcrypt.compare(credentials.password, user.password)
        if (!passwordMatch) {
          return null
        }
        const payload = { user }
        const token = jwt.sign(payload, process.env.NEXTAUTH_SECRET, { expiresIn: '5h' });
        console.log(payload);


        return { ...user, accessToken: token }
      }
    }),
  ],
  session: {
    strategy: "jwt",
    maxAge: 12 * 60 * 60 // 12 hours
  },
  callbacks: {
    jwt: async ({ token, user }) => {
      console.log('1');
      if (user) {
        console.log('2:', user);
        return {
          ...token,
          accessToken: user.accessToken
        }
      }
    },
    session: async ({ session, user, token }) => {

      console.log('session last', session);
      console.log('user last', user);
      console.log('token last', token);
      return {
        ...session,
        user: {
          ...session.user,
          accessToken: token.accessToken
        }
      }
    },
  },
  secret: process.env.NEXTAUTH_SECRET,
  debug: process.env.NODE_ENV === "development"
}

const handler = NextAuth(authOptions)

export { handler as GET, handler as POST }