next auth jwt session

Hello im having some problems with making the session for credentials provider i managed to make it for google provider using the Prisma adapter but since there's no adapters for the credentials i tried to make it with jwt but i don't have any idea if this is the right implementation

That's the github repo : https://github.com/CLOG9/PuzChess



And that's the auth code im having doubts about (from app/api/auth/[... nextauth]/options.ts):

callbacks: {
    async session({ session, token, user }) {
      console.log("im session", session);
      session.user = token;

      return session;
    },
    async jwt({ token, user }) {
      console.log("im token", token);

      return { ...token, ...user };
    },
  },
GitHub
a new chess puzzles platform made with next js. Contribute to CLOG9/PuzChess development by creating an account on GitHub.
Was this page helpful?