From 179c30b15b19b8206ec523f5314952e60240f7d7 Mon Sep 17 00:00:00 2001 From: Gustavo Kath Date: Tue, 9 Apr 2024 17:49:37 -0300 Subject: [PATCH] fix(#1920): Ignore redirect abortion emmited by loadUrl (#1959) --- .../src/ipc/network/authorize-user-in-window.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/bruno-electron/src/ipc/network/authorize-user-in-window.js b/packages/bruno-electron/src/ipc/network/authorize-user-in-window.js index 0318271b9..903ba846f 100644 --- a/packages/bruno-electron/src/ipc/network/authorize-user-in-window.js +++ b/packages/bruno-electron/src/ipc/network/authorize-user-in-window.js @@ -75,6 +75,11 @@ const authorizeUserInWindow = ({ authorizeUrl, callbackUrl, session }) => { try { await window.loadURL(authorizeUrl); } catch (error) { + // If browser redirects before load finished, loadURL throws an error with code ERR_ABORTED. This should be ignored. + if (error.code === 'ERR_ABORTED') { + console.debug('Ignoring ERR_ABORTED during authorizeUserInWindow'); + return; + } reject(error); window.close(); }