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

@@ -1,45 +1,46 @@
{
"name": "quests-template-basic",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"check:types": "tsc --noEmit",
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"preview": "vite preview"
},
"dependencies": {
"@orpc/client": "^1.8.8",
"@orpc/server": "^1.8.8",
"@orpc/tanstack-query": "^1.8.8",
"@tailwindcss/vite": "^4.1.12",
"@tanstack/react-query": "^5.85.5",
"hono": "^4.9.4",
"jsonrepair": "^3.13.0",
"openai": "^5.17.0",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"tailwindcss": "^4",
"unstorage": "^1.16.1",
"zod": "^4.0.17"
},
"devDependencies": {
"@eslint/js": "^10.0.0",
"@hono/vite-dev-server": "^0.20.1",
"@types/node": "^22",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^5.0.1",
"eslint": "^9",
"eslint-plugin-react-hooks": "^6.0.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"typescript": "^5",
"typescript-eslint": "^8.40.0",
"vite": "^7.1.3",
"vite-tsconfig-paths": "^5.1.4"
}
}
{
"name": "quests-template-basic",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"check:types": "tsc --noEmit",
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"preview": "vite preview"
},
"dependencies": {
"@orpc/client": "^1.8.8",
"@orpc/server": "^1.8.8",
"@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",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"tailwindcss": "^4",
"unstorage": "^1.16.1",
"zod": "^4.0.17"
},
"devDependencies": {
"@eslint/js": "^10.0.0",
"@hono/vite-dev-server": "^0.20.1",
"@types/node": "^22",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^5.0.1",
"eslint": "^9",
"eslint-plugin-react-hooks": "^6.0.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"typescript": "^5",
"typescript-eslint": "^8.40.0",
"vite": "^7.1.3",
"vite-tsconfig-paths": "^5.1.4"
}
}

6219
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

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