From c27118d6fe16c1eff00aea37d21db24a4990aab4 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Sat, 4 Apr 2026 19:10:55 +0800 Subject: [PATCH] style(dashboard): format and fix types in authLoginProof --- dashboard/src/utils/authLoginProof.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dashboard/src/utils/authLoginProof.ts b/dashboard/src/utils/authLoginProof.ts index 7a71a608b..bd4234d73 100644 --- a/dashboard/src/utils/authLoginProof.ts +++ b/dashboard/src/utils/authLoginProof.ts @@ -39,7 +39,7 @@ async function signNonce(secret: BufferSource, nonce: string): Promise { secret, { name: "HMAC", hash: "SHA-256" }, false, - ["sign"] + ["sign"], ); const signature = await subtle.sign("HMAC", key, encoder.encode(nonce)); return bytesToHex(signature); @@ -56,7 +56,7 @@ async function createPbkdf2Proof( const passwordKey = await subtle.importKey( "raw", - encoder.encode(password), + encoder.encode(password).buffer as ArrayBuffer, "PBKDF2", false, ["deriveBits"], @@ -65,11 +65,11 @@ async function createPbkdf2Proof( { name: "PBKDF2", hash: "SHA-256", - salt: hexToBytes(challenge.salt), - iterations: challenge.iterations + salt: hexToBytes(challenge.salt).buffer as ArrayBuffer, + iterations: challenge.iterations, }, passwordKey, - 256 + 256, ); return signNonce(derivedBits, challenge.nonce); @@ -80,7 +80,7 @@ async function createLegacyMd5Proof( challenge: LoginChallenge, ): Promise { return signNonce( - encoder.encode(md5(password).toLowerCase()), + encoder.encode(md5(password).toLowerCase()).buffer as ArrayBuffer, challenge.nonce, ); }