cryptoUtils.decrypt alligned with encrypt in regards of handling extra space in password file

This commit is contained in:
Jakub Trávník 2025-12-04 08:43:17 +01:00 committed by Nicolas Meienberger
parent fc482e9729
commit 780fdae63e

View file

@ -47,7 +47,7 @@ const decrypt = async (encryptedData: string) => {
return encryptedData;
}
const secret = await Bun.file(RESTIC_PASS_FILE).text();
const secret = (await Bun.file(RESTIC_PASS_FILE).text()).trim();
const parts = encryptedData.split(":").slice(1); // Remove prefix
const saltHex = parts.shift() as string;