fix(api): validate BETTER_AUTH_SECRET and fix lockfile specifier (GRO-118)
- Add startup validation for BETTER_AUTH_SECRET when auth is enabled - Fix pnpm-lock.yaml typescript specifier mismatch (^5.9.3 → ^5.7.3) Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -9,6 +9,12 @@ const OIDC_CLIENT_SECRET = process.env.OIDC_CLIENT_SECRET;
|
|||||||
const BETTER_AUTH_SECRET = process.env.BETTER_AUTH_SECRET;
|
const BETTER_AUTH_SECRET = process.env.BETTER_AUTH_SECRET;
|
||||||
const BETTER_AUTH_URL = process.env.BETTER_AUTH_URL ?? "http://localhost:3000";
|
const BETTER_AUTH_URL = process.env.BETTER_AUTH_URL ?? "http://localhost:3000";
|
||||||
|
|
||||||
|
if (!BETTER_AUTH_SECRET && process.env.AUTH_DISABLED !== "true") {
|
||||||
|
throw new Error(
|
||||||
|
"[FATAL] BETTER_AUTH_SECRET environment variable is required when auth is enabled"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export const auth = betterAuth({
|
export const auth = betterAuth({
|
||||||
database: drizzleAdapter(getDb(), {
|
database: drizzleAdapter(getDb(), {
|
||||||
provider: "pg",
|
provider: "pg",
|
||||||
|
|||||||
Generated
+1
-1
@@ -136,7 +136,7 @@ importers:
|
|||||||
specifier: ^26.1.0
|
specifier: ^26.1.0
|
||||||
version: 26.1.0
|
version: 26.1.0
|
||||||
typescript:
|
typescript:
|
||||||
specifier: ^5.9.3
|
specifier: ^5.7.3
|
||||||
version: 5.9.3
|
version: 5.9.3
|
||||||
typescript-eslint:
|
typescript-eslint:
|
||||||
specifier: ^8.20.0
|
specifier: ^8.20.0
|
||||||
|
|||||||
Reference in New Issue
Block a user