Unlink account doesn't work with allowDifferentEmails enabled

I'm working on a project and I have this auth config :
export const auth = betterAuth({
  baseURL: process.env.BETTER_AUTH_URL!,
  database: prismaAdapter(prisma, { provider: 'postgresql' }),
  emailAndPassword: { enabled: true },
  socialProviders: {
    github: {
      clientId: process.env.GITHUB_CLIENT_ID!,
      clientSecret: process.env.GITHUB_CLIENT_SECRET!
    }
  },
  user: {
    deleteUser: { enabled: true }
  },
  account: {
    accountLinking: { enabled: true, allowDifferentEmails: true }
  }
})


And this button :
<UiButton
  variant="link"
  @click="client.unlinkAccount({ providerId: 'github' })"
  class="ml-auto"
>
  Supprimer
</UiButton>


The request succeed but when I reload the page the client.listAccounts() return the "unlinked" account
Was this page helpful?