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:
2025-09-30 11:03:28 +02:00
parent 072c7985c7
commit af0502baa6
3 changed files with 3164 additions and 3150 deletions

View File

@@ -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(),