`trustedProviders` is not respected with social login
Author: jvllmrCreated Sep 17, 2026Updated Sep 17, 2026
Is this suited for github?
- Yes, this is suited for github
Reproduction
- Configure auth with genericOAuth/Social plugin
- Set providerId from genericOAuth in
account.trustedProviderssetting - Try to login with unlinked account. Error is raised because account is not linked
Current vs. Expected behavior
Currently I expect a forced link to happen as described in https://better-auth.com/docs/concepts/users-accounts#forced-linking , but instead I receive an error page. Only workaround right now is to set requireLocalEmailVerified to false.
What version of Better Auth are you using?
1.7.4
System info
{
"system": {
"platform": "linux",
"arch": "x64",
"version": "#1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025",
"release": "6.6.87.2-microsoft-standard-WSL2",
"cpuCount": 12,
"cpuModel": "12th Gen Intel(R) Core(TM) i7-1255U",
"totalMemory": "15.23 GB",
"freeMemory": "6.31 GB"
},
"node": {
"version": "v24.18.0",
"env": "development"
},
"packageManager": {
"name": "pnpm",
"version": "12.4.1"
},
"frameworks": [
{
"name": "react",
"version": "19.3.0"
}
],
"databases": [
{
"name": "postgres",
"version": "3.4.9"
},
{
"name": "drizzle",
"version": "0.45.2"
}
],
"betterAuth": {
"version": "1.7.4",
"config": null
}
}Which area(s) are affected? (Select all that apply)
Backend
Auth config (if applicable)
import { betterAuth } from "better-auth"
export const auth = betterAuth({
emailAndPassword: {
enabled: true
},
});Additional context
I assume this is because trustProvidersByName is not set to true here: https://github.com/better-auth/better-auth/blob/641630f06c128e786fd6a710b075e41e9f9adec9/packages/better-auth/src/api/routes/callback.ts#L372
Source: better-auth/better-auth