From d3d33c1e08d8b79b2b9958e0b206e752442155a7 Mon Sep 17 00:00:00 2001 From: kilyabin <65072190+kilyabin@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:49:48 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0?= =?UTF-8?q?=20=D1=82=D0=B8=D0=BF=D0=BE=D0=B2=20=D0=B2=20crypto.timingSafeE?= =?UTF-8?q?qual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Добавлено приведение типа Buffer к Uint8Array для совместимости с ArrayBufferView - Buffer в Node.js наследуется от Uint8Array и совместим в runtime --- src/shared/utils/auth.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/utils/auth.ts b/src/shared/utils/auth.ts index 7bc79d7..521a819 100644 --- a/src/shared/utils/auth.ts +++ b/src/shared/utils/auth.ts @@ -40,7 +40,11 @@ export function verifyPassword(password: string): boolean { try { const passwordBuffer = Buffer.from(password, 'utf8') const adminPasswordBuffer = Buffer.from(adminPassword, 'utf8') - return crypto.timingSafeEqual(passwordBuffer, adminPasswordBuffer) + // Buffer в Node.js наследуется от Uint8Array и совместим с ArrayBufferView + return crypto.timingSafeEqual( + passwordBuffer as Uint8Array, + adminPasswordBuffer as Uint8Array + ) } catch { return false }