diff --git a/docs/content/docs/concepts/users-accounts.mdx b/docs/content/docs/concepts/users-accounts.mdx index f427bb7d99..682da3f0de 100644 --- a/docs/content/docs/concepts/users-accounts.mdx +++ b/docs/content/docs/concepts/users-accounts.mdx @@ -267,7 +267,7 @@ Account linking enables users to associate multiple authentication methods with If account linking is disabled, no accounts can be linked, regardless of the provider or email verification status. ```ts title="auth.ts" -const auth = new BetterAuth({ +export const auth = betterAuth({ account: { accountLinking: { enabled: true, @@ -281,7 +281,7 @@ const auth = new BetterAuth({ You can specify a list of "trusted providers." When a user logs in using a trusted provider, their account will be automatically linked even if the provider doesn’t confirm the email verification status. Use this with caution as it may increase the risk of account takeover. ```ts title="auth.ts" -const auth = new BetterAuth({ +export const auth = betterAuth({ account: { accountLinking: { enabled: true, @@ -306,7 +306,7 @@ Users already signed in can manually link their account to additional social pro If you want your users to be able to link a social account with a different email address than the user, or if you want to use a provider that does not return email addresses, you will need to enable this in the account linking settings. ```ts title="auth.ts" - const auth = betterAuth({ + export const auth = betterAuth({ account: { accountLinking: { allowDifferentEmails: true @@ -347,11 +347,11 @@ await authClient.unlinkAccount({ If the account doesn't exist, it will throw an error. Additionally, if the user only has one account, the unlinking process will fail to prevent account lockout unless `allowUnlinkingAll` is set to `true`. ```ts title="auth.ts" -const auth = betterAuth({ +export const auth = betterAuth({ account: { accountLinking: { allowUnlinkingAll: true } }, }); -``` \ No newline at end of file +```