From 2a508cb7bfa541193901e8f89dd720635e334c63 Mon Sep 17 00:00:00 2001 From: Tobias Gurtzick Date: Mon, 8 Jan 2024 12:38:48 +0100 Subject: [PATCH] burn after reading only Signed-off-by: Tobias Gurtzick --- js/privatebin.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 4fd5f1c7..23a4fe20 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -4862,7 +4862,8 @@ jQuery.PrivateBin = (function($, RawDeflate) { const pw = TopNav.getPassword() - if(pw && pw.length) { + // only execute when it is a single time view + if(pw && pw.length && TopNav.getBurnAfterReading()) { const sm = CryptTool.getSymmetricKey(); @@ -5032,9 +5033,12 @@ jQuery.PrivateBin = (function($, RawDeflate) { // prepare server interaction ServerInteraction.prepare(); - // This is not needed when encrypting browser side - // ServerInteraction.setCryptParameters(TopNav.getPassword()); - ServerInteraction.setCryptParameters(''); + if(!TopNav.getBurnAfterReading()) { + ServerInteraction.setCryptParameters(TopNav.getPassword()); + } else { + // not needed in this scenario + ServerInteraction.setCryptParameters(''); + } // set success/fail functions ServerInteraction.setSuccess(showCreatedPaste);