fix: Load admin credentials from .env file
- Add dotenv dependency and load .env configuration in auth.ts - Admin credentials now read from environment variables: - ADMIN_USERNAME (default: owner) - ADMIN_PASSWORD_HASH (default: admin123 hash) - ADMIN_EMAIL (default: owner@stargirlnails.de) - Remove hardcoded admin credentials - Add fallback values for backward compatibility - Clear existing user storage to force recreation with new credentials
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
"@orpc/tanstack-query": "^1.8.8",
|
||||
"@tailwindcss/vite": "^4.1.12",
|
||||
"@tanstack/react-query": "^5.85.5",
|
||||
"dotenv": "^17.2.3",
|
||||
"hono": "^4.9.4",
|
||||
"jsonrepair": "^3.13.0",
|
||||
"openai": "^5.17.0",
|
||||
|
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@@ -23,6 +23,9 @@ importers:
|
||||
'@tanstack/react-query':
|
||||
specifier: ^5.85.5
|
||||
version: 5.85.5(react@19.1.1)
|
||||
dotenv:
|
||||
specifier: ^17.2.3
|
||||
version: 17.2.3
|
||||
hono:
|
||||
specifier: ^4.9.4
|
||||
version: 4.9.4
|
||||
@@ -942,6 +945,10 @@ packages:
|
||||
resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
dotenv@17.2.3:
|
||||
resolution: {integrity: sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
electron-to-chromium@1.5.171:
|
||||
resolution: {integrity: sha512-scWpzXEJEMrGJa4Y6m/tVotb0WuvNmasv3wWVzUAeCgKU0ToFOhUW6Z+xWnRQANMYGxN4ngJXIThgBJOqzVPCQ==}
|
||||
|
||||
@@ -2498,6 +2505,8 @@ snapshots:
|
||||
|
||||
detect-libc@2.0.4: {}
|
||||
|
||||
dotenv@17.2.3: {}
|
||||
|
||||
electron-to-chromium@1.5.171: {}
|
||||
|
||||
enhanced-resolve@5.18.3:
|
||||
|
@@ -2,6 +2,10 @@ import { call, os } from "@orpc/server";
|
||||
import { z } from "zod";
|
||||
import { randomUUID } from "crypto";
|
||||
import { createKV } from "@/server/lib/create-kv";
|
||||
import { config } from "dotenv";
|
||||
|
||||
// Load environment variables from .env file
|
||||
config();
|
||||
|
||||
const UserSchema = z.object({
|
||||
id: z.string(),
|
||||
|
Reference in New Issue
Block a user