project setup with core files including configuration, package management, and basic structure. Added .gitignore, README, and various TypeScript types for CMS components. Implemented initial components and layouts for the application.

This commit is contained in:
Peter Meier
2025-12-13 23:26:13 +01:00
parent ea288a5bbc
commit b1a556dc6d
167 changed files with 19057 additions and 131 deletions

View File

@@ -0,0 +1,31 @@
import bcrypt from "bcryptjs";
import { logger } from "../monitoring/logger.js";
const SALT_ROUNDS = 10;
/**
* Hasht ein Passwort
*/
export async function hashPassword(password: string): Promise<string> {
try {
return await bcrypt.hash(password, SALT_ROUNDS);
} catch (error) {
logger.error("Password hashing failed", { error });
throw new Error("Fehler beim Hashen des Passworts");
}
}
/**
* Vergleicht ein Passwort mit einem Hash
*/
export async function comparePassword(
password: string,
hash: string
): Promise<boolean> {
try {
return await bcrypt.compare(password, hash);
} catch (error) {
logger.error("Password comparison failed", { error });
return false;
}
}