mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-22 23:02:40 +01:00
fix: Oauth2: Reuse TLS Certifcate valiadation and custom CA settings from preferences when accessing Auth and Token URLs (#2071)
#1684 #1003
This commit is contained in:
parent
4e95fd548d
commit
12263a71b6
@ -1,4 +1,5 @@
|
||||
const { BrowserWindow } = require('electron');
|
||||
const { preferencesUtil } = require('../../store/preferences');
|
||||
|
||||
const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
@ -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')) {
|
||||
|
Loading…
Reference in New Issue
Block a user