From 3ee121cc5a089454649cc24f43610c2152978888 Mon Sep 17 00:00:00 2001 From: Samuel Date: Sat, 7 Dec 2024 20:48:26 +0100 Subject: [PATCH] Merge commit from fork * ask for confirmation from users * callback false if user doesn't accept --- packages/altair-electron/src/app/index.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/altair-electron/src/app/index.ts b/packages/altair-electron/src/app/index.ts index 3556508ad9..0a8895ffd8 100644 --- a/packages/altair-electron/src/app/index.ts +++ b/packages/altair-electron/src/app/index.ts @@ -163,9 +163,22 @@ export class ElectronApp { 'certificate-error', (event, webContents, url, error, certificate, callback) => { event.preventDefault(); - callback(true); // Inform user of invalid certificate webContents.send('certificate-error', error); + dialog + .showMessageBox({ + type: 'question', + title: 'Invalid Certificate', + message: `You are making a request with an invalid certificate. Do you want to continue? (URL: ${url}, Issuer: ${certificate.issuerName}, Subject: ${certificate.subjectName}, Error: ${error})`, + buttons: ['Yes', 'No'], + }) + .then((result) => { + if (result.response === 0) { + callback(true); + } else { + callback(false); + } + }); } );