From 5fe5451f5ce47f5771be470f884413389a7f43b9 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sun, 26 May 2024 08:20:03 +0530 Subject: [PATCH] Fix key length error [error] failed to redirect to accounts page: TypeError: invalid key length --- web/apps/photos/src/components/Sidebar/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/apps/photos/src/components/Sidebar/index.tsx b/web/apps/photos/src/components/Sidebar/index.tsx index c01ffe48bb..67f61d1f4d 100644 --- a/web/apps/photos/src/components/Sidebar/index.tsx +++ b/web/apps/photos/src/components/Sidebar/index.tsx @@ -14,6 +14,7 @@ import { ACCOUNTS_PAGES, PHOTOS_PAGES as PAGES, } from "@ente/shared/constants/pages"; +import ComlinkCryptoWorker from "@ente/shared/crypto"; import { getRecoveryKey } from "@ente/shared/crypto/helpers"; import { encryptToB64, @@ -494,9 +495,10 @@ const UtilitySection: React.FC = ({ closeSidebar }) => { const resetSecret = await generateEncryptionKey(); + const cryptoWorker = await ComlinkCryptoWorker.getInstance(); const encryptionResult = await encryptToB64( resetSecret, - recoveryKey, + await cryptoWorker.fromHex(recoveryKey), ); await configurePasskeyRecovery(