mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
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:
@@ -18,6 +18,10 @@ import { getHubSpotUTK, submitToHubSpot } from "../utils/tracking/hubspot";
|
||||
import { sendEmail } from "../verification/send-verification-email";
|
||||
import { getPublicIpWithFallback } from "../wss/utils";
|
||||
|
||||
const query = await db.query.ssoProvider.findMany();
|
||||
|
||||
const trustedProviders = query.map((provider) => provider.providerId);
|
||||
|
||||
const { handler, api } = betterAuth({
|
||||
database: drizzleAdapter(db, {
|
||||
provider: "pg",
|
||||
@@ -43,17 +47,14 @@ const { handler, api } = betterAuth({
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...(IS_CLOUD
|
||||
? {
|
||||
account: {
|
||||
accountLinking: {
|
||||
enabled: true,
|
||||
trustedProviders: ["github", "google"],
|
||||
allowDifferentEmails: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
|
||||
account: {
|
||||
accountLinking: {
|
||||
enabled: true,
|
||||
trustedProviders: ["github", "google", ...(trustedProviders || [])],
|
||||
allowDifferentEmails: true,
|
||||
},
|
||||
},
|
||||
appName: "Dokploy",
|
||||
socialProviders: {
|
||||
github: {
|
||||
|
||||
Reference in New Issue
Block a user