From 306f2d5f12440275e3202a52e8555eb88d9a34be Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:24:39 +0100 Subject: [PATCH] cut key for 16 size --- src/lib/helpers/verifyRequest.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/helpers/verifyRequest.ts b/src/lib/helpers/verifyRequest.ts index 229193f..2a0ae08 100644 --- a/src/lib/helpers/verifyRequest.ts +++ b/src/lib/helpers/verifyRequest.ts @@ -14,10 +14,10 @@ export const verifyRequest = ( try { const decipher = new Ecb( Aes, - new TextEncoder().encode( + new TextEncoder().encode(( Deno.env.get("SERVER_SECRET_KEY") || - konfigStore.get("server.secret_key") as string, - ), + konfigStore.get("server.secret_key") as string + ).substring(0, 16)), Padding.PKCS7, ); @@ -32,7 +32,6 @@ export const verifyRequest = ( } // only allow ID to live for 6 hours if ((timestampNow + 6 * 60 * 60) - parsedTimestampInt < 0) { - console.log("sup lol") return false; } } catch (_) {