mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-18 21:15:16 +02:00
refactor(web): update environment variable handling to use build-time constants for auth type, deployment mode, and ETL service
This commit is contained in:
parent
3f69bfd5e4
commit
695da76f2e
3 changed files with 15 additions and 11 deletions
|
|
@ -1,14 +1,18 @@
|
|||
import { connection } from "next/server";
|
||||
import { RuntimeConfigProvider } from "@/components/providers/runtime-config";
|
||||
import { AUTH_TYPE, DEPLOYMENT_MODE, ETL_SERVICE } from "@/lib/env-config";
|
||||
import {
|
||||
BUILD_TIME_AUTH_TYPE,
|
||||
BUILD_TIME_DEPLOYMENT_MODE,
|
||||
BUILD_TIME_ETL_SERVICE,
|
||||
} from "@/lib/env-config";
|
||||
|
||||
export async function RuntimeConfig({ children }: { children: React.ReactNode }) {
|
||||
await connection();
|
||||
|
||||
const value = {
|
||||
authType: process.env.AUTH_TYPE ?? AUTH_TYPE,
|
||||
etlService: process.env.ETL_SERVICE ?? ETL_SERVICE,
|
||||
deploymentMode: process.env.DEPLOYMENT_MODE ?? DEPLOYMENT_MODE,
|
||||
authType: process.env.AUTH_TYPE ?? BUILD_TIME_AUTH_TYPE,
|
||||
etlService: process.env.ETL_SERVICE ?? BUILD_TIME_ETL_SERVICE,
|
||||
deploymentMode: process.env.DEPLOYMENT_MODE ?? BUILD_TIME_DEPLOYMENT_MODE,
|
||||
};
|
||||
|
||||
return <RuntimeConfigProvider value={value}>{children}</RuntimeConfigProvider>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue