mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-21 20:41:41 +02: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 { BrowserWindow } = require('electron');
|
||||||
|
const { preferencesUtil } = require('../../store/preferences');
|
||||||
|
|
||||||
const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => {
|
const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
@ -22,6 +23,12 @@ const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => {
|
|||||||
});
|
});
|
||||||
window.on('ready-to-show', window.show.bind(window));
|
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) {
|
function onWindowRedirect(url) {
|
||||||
// check if the url contains an authorization code
|
// check if the url contains an authorization code
|
||||||
if (new URL(url).searchParams.has('code')) {
|
if (new URL(url).searchParams.has('code')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user