fix: correct accountLinking default to true (#6963)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
Taesu
2025-12-25 02:11:06 +09:00
committed by GitHub
parent 12f6f954ef
commit 4f1ec5414e
2 changed files with 3 additions and 3 deletions

View File

@@ -420,7 +420,7 @@ Store account data after OAuth flow in a cookie. This is useful for database-les
Configuration for account linking.
- `enabled`: Enable account linking (default: `false`)
- `enabled`: Enable account linking (default: `true`)
- `trustedProviders`: List of trusted providers
- `allowDifferentEmails`: Allow users to link accounts with different email addresses
- `allowUnlinkingAll`: Allow users to unlink all accounts

View File

@@ -148,8 +148,8 @@ export const oneTap = (options?: OneTapOptions | undefined) =>
if (!account) {
const accountLinking = ctx.context.options.account?.accountLinking;
const shouldLinkAccount =
accountLinking?.enabled &&
(accountLinking.trustedProviders?.includes("google") ||
accountLinking?.enabled !== false &&
(accountLinking?.trustedProviders?.includes("google") ||
email_verified);
if (shouldLinkAccount) {
await ctx.context.internalAdapter.linkAccount({