mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-13 23:45:17 +00: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 { 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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user