mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-02-25 20:35:10 +00:00
feat(auth): introduce BETTER_AUTH_SECRET for better authentication handling
- Added BETTER_AUTH_SECRET constant to manage authentication secret, defaulting to a predefined value if not set in the environment. - Updated betterAuth configuration to utilize BETTER_AUTH_SECRET for enhanced security in authentication processes.
This commit is contained in:
@@ -4,6 +4,10 @@ import Docker from "dockerode";
|
||||
export const IS_CLOUD = process.env.IS_CLOUD === "true";
|
||||
export const docker = new Docker();
|
||||
|
||||
export const BETTER_AUTH_SECRET =
|
||||
process.env.BETTER_AUTH_SECRET ||
|
||||
"RXu/xoLHaA1Xgs+R8a0LjVjCVOEnWISQWxw7nXxlvKo=";
|
||||
|
||||
export const paths = (isServer = false) => {
|
||||
const BASE_PATH =
|
||||
isServer || process.env.NODE_ENV === "production"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
||||
import { APIError } from "better-auth/api";
|
||||
import { admin, apiKey, organization, twoFactor } from "better-auth/plugins";
|
||||
import { and, desc, eq } from "drizzle-orm";
|
||||
import { IS_CLOUD } from "../constants";
|
||||
import { BETTER_AUTH_SECRET, IS_CLOUD } from "../constants";
|
||||
import { db } from "../db";
|
||||
import * as schema from "../db/schema";
|
||||
import { getTrustedOrigins, getUserByToken } from "../services/admin";
|
||||
@@ -29,6 +29,7 @@ const { handler, api } = betterAuth({
|
||||
"/organization/update",
|
||||
"/organization/delete",
|
||||
],
|
||||
secret: BETTER_AUTH_SECRET,
|
||||
appName: "Dokploy",
|
||||
socialProviders: {
|
||||
github: {
|
||||
|
||||
Reference in New Issue
Block a user