Next.js Discord

Discord Forum

Extending Account Table Information

Unanswered
Highlander posted this in #help-forum
Open in Discord
HighlanderOP
Hey, I wanted to add additional information in the account table:

async signIn({ user, account, profile }) {
            if (account?.provider === "google") {
                await prisma.account.update({
                    where: {
                        provider_providerAccountId: {
                            provider: account.provider,
                            providerAccountId: account.providerAccountId
                        },
                    },
                    data: {
                        email: profile?.email as string,
                        image: profile?.picture as string
                    }
                })
            }
            return true;
        }


But the account entry doesn’t exist at that point, how could I solve this issue?

0 Replies