Skip to content

Commit

Permalink
fix: Oauth2: Reuse TLS Certifcate valiadation and custom CA settings …
Browse files Browse the repository at this point in the history
…from preferences when accessing Auth and Token URLs (usebruno#2071)

usebruno#1684
usebruno#1003
  • Loading branch information
pietrygamat authored and jwetzell committed Aug 2, 2024
1 parent a744903 commit faa9ece
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { BrowserWindow } = require('electron');
const { preferencesUtil } = require('../../store/preferences');

const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => {
return new Promise(async (resolve, reject) => {
Expand All @@ -22,6 +23,12 @@ const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => {
});
window.on('ready-to-show', window.show.bind(window));

// We want browser window to comply with "SSL/TLS Certificate Verification" toggle in Preferences
window.webContents.on('certificate-error', (event, url, error, certificate, callback) => {
event.preventDefault();
callback(!preferencesUtil.shouldVerifyTls());
});

function onWindowRedirect(url) {
// check if the url contains an authorization code
if (new URL(url).searchParams.has('code')) {
Expand Down

0 comments on commit faa9ece

Please sign in to comment.