Merge pull request #3685 from Dokploy/feat/add-trusted-providers-dinamically

feat(auth): dynamically add trusted providers for account linking
This commit is contained in:
Mauricio Siu
2026-02-10 23:48:13 -06:00
committed by GitHub
+12 -11
View File
@@ -18,6 +18,10 @@ import { getHubSpotUTK, submitToHubSpot } from "../utils/tracking/hubspot";
import { sendEmail } from "../verification/send-verification-email"; import { sendEmail } from "../verification/send-verification-email";
import { getPublicIpWithFallback } from "../wss/utils"; import { getPublicIpWithFallback } from "../wss/utils";
const query = await db.query.ssoProvider.findMany();
const trustedProviders = query.map((provider) => provider.providerId);
const { handler, api } = betterAuth({ const { handler, api } = betterAuth({
database: drizzleAdapter(db, { database: drizzleAdapter(db, {
provider: "pg", provider: "pg",
@@ -43,17 +47,14 @@ const { handler, api } = betterAuth({
}, },
} }
: {}), : {}),
...(IS_CLOUD
? { account: {
account: { accountLinking: {
accountLinking: { enabled: true,
enabled: true, trustedProviders: ["github", "google", ...(trustedProviders || [])],
trustedProviders: ["github", "google"], allowDifferentEmails: true,
allowDifferentEmails: true, },
}, },
},
}
: {}),
appName: "Dokploy", appName: "Dokploy",
socialProviders: { socialProviders: {
github: { github: {