From aff1ec0a7b23c8e1522691c8ecdd6fccb47dc08e Mon Sep 17 00:00:00 2001 From: Taesu <166604494+bytaesu@users.noreply.github.com> Date: Tue, 20 Jan 2026 03:33:46 +0900 Subject: [PATCH] chore: remove type casting for provider id (#7468) --- packages/better-auth/src/api/routes/callback.ts | 4 +--- packages/better-auth/src/oauth2/link-account.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/better-auth/src/api/routes/callback.ts b/packages/better-auth/src/api/routes/callback.ts index 0340583be9..73eda7023c 100644 --- a/packages/better-auth/src/api/routes/callback.ts +++ b/packages/better-auth/src/api/routes/callback.ts @@ -172,9 +172,7 @@ export const callbackOAuth = createAuthEndpoint( if (link) { const trustedProviders = c.context.options.account?.accountLinking?.trustedProviders; - const isTrustedProvider = trustedProviders?.includes( - provider.id as "apple", - ); + const isTrustedProvider = trustedProviders?.includes(provider.id); if ( (!isTrustedProvider && !userInfo.emailVerified) || c.context.options.account?.accountLinking?.enabled === false diff --git a/packages/better-auth/src/oauth2/link-account.ts b/packages/better-auth/src/oauth2/link-account.ts index 3cb91fcc76..9791e0022d 100644 --- a/packages/better-auth/src/oauth2/link-account.ts +++ b/packages/better-auth/src/oauth2/link-account.ts @@ -48,7 +48,7 @@ export async function handleOAuthUserInfo( c.context.options.account?.accountLinking?.trustedProviders; const isTrustedProvider = opts.isTrustedProvider || - trustedProviders?.includes(account.providerId as "apple"); + trustedProviders?.includes(account.providerId); if ( (!isTrustedProvider && !userInfo.emailVerified) || c.context.options.account?.accountLinking?.enabled === false