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
parent f4df9e935d
commit 9fec6883f6

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;