Next.js Discord

Discord Forum

I want to add more values on session.

Unanswered
Tomistoma posted this in #help-forum
Open in Discord
TomistomaOP
import NextAuth, { NextAuthOptions } from "next-auth";
import { signIn } from "next-auth/client";
import DiscordProvider from "next-auth/providers/discord";
export const authOptions: NextAuthOptions = {
  providers: [
    DiscordProvider({
      clientId: process.env.DISCORD_ID as string,
      clientSecret: process.env.DISCORD_SECRET as string,

    }),
  ],
  callbacks: {
    signIn: async (user, account, profile) => {
      console.log(user.user)
      return user.user
    },

  },
};

const handler = NextAuth(authOptions);

export { handler as GET, handler as POST };

There is my route.ts code, but i cant add id prop on session. When i use console.log(session) i get this output
{
  user: {
    name: '',
    email: '',
    image: ''
  }

But there is no id, how can i add id prop on session?

0 Replies