fix(core): add credential and siwe to trustedProviders type

- Replace 'email-password' with 'credential' (the actual providerId used)
- Add 'siwe' for Sign-In with Ethereum plugin support
- Update documentation to use 'credential' instead of 'email-password'

The previous 'email-password' value in the type didn't match any actual
providerId - password-based accounts use 'credential' as their providerId.

Co-authored-by: taesu <taesu@better-auth.com>
This commit is contained in:
Cursor Agent
2026-01-18 02:18:55 +00:00
parent a58c1ccbba
commit ac6426a59c
3 changed files with 3 additions and 3 deletions

View File

@@ -115,7 +115,7 @@ export const auth = betterAuth({
account: { // [!code highlight]
accountLinking: { // [!code highlight]
enabled: true, // [!code highlight]
trustedProviders: ["email-password", "github"], // [!code highlight]
trustedProviders: ["credential", "github"], // [!code highlight]
}, // [!code highlight]
}, // [!code highlight]
});

View File

@@ -408,7 +408,7 @@ export const auth = betterAuth({
storeAccountCookie: true, // Store account data after OAuth flow in a cookie (useful for database-less flows)
accountLinking: {
enabled: true,
trustedProviders: ["google", "github", "email-password"],
trustedProviders: ["google", "github", "credential"],
allowDifferentEmails: false
}
},

View File

@@ -927,7 +927,7 @@ export type BetterAuthOptions = {
*/
trustedProviders?: Array<
LiteralUnion<
SocialProviderList[number] | "email-password" | "sso",
SocialProviderList[number] | "credential" | "sso" | "siwe",
string
>
>;