fix(#1920): Ignore redirect abortion emmited by loadUrl (#1959)

This commit is contained in:
Gustavo Kath 2024-04-09 17:49:37 -03:00 committed by GitHub
parent 5a31daf84a
commit 179c30b15b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();
}