mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-24 16:11:53 -05:00
fix: correct accountLinking default to true (#6963)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user