mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-06 20:22:14 +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 IS_CLOUD = process.env.IS_CLOUD === "true";
|
||||||
export const docker = new Docker();
|
export const docker = new Docker();
|
||||||
|
|
||||||
|
export const BETTER_AUTH_SECRET =
|
||||||
|
process.env.BETTER_AUTH_SECRET ||
|
||||||
|
"RXu/xoLHaA1Xgs+R8a0LjVjCVOEnWISQWxw7nXxlvKo=";
|
||||||
|
|
||||||
export const paths = (isServer = false) => {
|
export const paths = (isServer = false) => {
|
||||||
const BASE_PATH =
|
const BASE_PATH =
|
||||||
isServer || process.env.NODE_ENV === "production"
|
isServer || process.env.NODE_ENV === "production"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|||||||
import { APIError } from "better-auth/api";
|
import { APIError } from "better-auth/api";
|
||||||
import { admin, apiKey, organization, twoFactor } from "better-auth/plugins";
|
import { admin, apiKey, organization, twoFactor } from "better-auth/plugins";
|
||||||
import { and, desc, eq } from "drizzle-orm";
|
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 { db } from "../db";
|
||||||
import * as schema from "../db/schema";
|
import * as schema from "../db/schema";
|
||||||
import { getTrustedOrigins, getUserByToken } from "../services/admin";
|
import { getTrustedOrigins, getUserByToken } from "../services/admin";
|
||||||
@@ -29,6 +29,7 @@ const { handler, api } = betterAuth({
|
|||||||
"/organization/update",
|
"/organization/update",
|
||||||
"/organization/delete",
|
"/organization/delete",
|
||||||
],
|
],
|
||||||
|
secret: BETTER_AUTH_SECRET,
|
||||||
appName: "Dokploy",
|
appName: "Dokploy",
|
||||||
socialProviders: {
|
socialProviders: {
|
||||||
github: {
|
github: {
|
||||||
|
|||||||
Reference in New Issue
Block a user