From 0be17882d597b7f2344c8927a5ab724ff0c1b840 Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Thu, 12 Mar 2026 16:09:34 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix:=20bcrypt=20statt=20argon2?= =?UTF-8?q?=20(kompatibel)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/auth.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/auth.ts b/src/utils/auth.ts index f016f4a..13d5ad6 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -1,5 +1,5 @@ import { create, verify, getNumericDate } from "https://deno.land/x/djwt@v3.0.1/mod.ts"; -import { hash, verify as verifyHash } from "https://deno.land/x/argon2@v0.9.2/mod.ts"; +import * as bcrypt from "https://deno.land/x/bcrypt@v0.4.1/mod.ts"; import type { JWTPayload, UserRole } from "../types/index.ts"; const JWT_SECRET = Deno.env.get("JWT_SECRET") || "secu-super-secret-key-change-in-production"; @@ -66,15 +66,15 @@ export async function verifyToken(token: string): Promise { } } -// Hash password with Argon2 +// Hash password with bcrypt export async function hashPassword(password: string): Promise { - return await hash(password); + return await bcrypt.hash(password); } // Verify password export async function verifyPassword(password: string, hashedPassword: string): Promise { try { - return await verifyHash(password, hashedPassword); + return await bcrypt.compare(password, hashedPassword); } catch { return false; }