Skip to content

Commit

Permalink
Merge commit from fork
Browse files Browse the repository at this point in the history
* ask for confirmation from users

* callback false if user doesn't accept
  • Loading branch information
imolorhe authored Dec 7, 2024
1 parent 004f645 commit 3ee121c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/altair-electron/src/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}
);

Expand Down

0 comments on commit 3ee121c

Please sign in to comment.