check for sodium in decrypt function

This commit is contained in:
Mario
2025-12-10 07:34:36 +00:00
parent bb49a51be3
commit 48030617ab

View File

@@ -50,6 +50,10 @@ async function sodium_encrypt(element) {
}
async function sodium_decrypt(payload, element) {
if (!window.sodium) {
window.sodium = await SodiumPlus.auto();
}
let arr = JSON.parse(window.atob(payload));
if (arr.alg !== 'XSalsa20') {